aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdcore.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r--drivers/mtd/mtdcore.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 21e3cdc04036..3ef01baef9b6 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -507,6 +507,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
507{ 507{
508 struct nvmem_config config = {}; 508 struct nvmem_config config = {};
509 509
510 config.id = -1;
510 config.dev = &mtd->dev; 511 config.dev = &mtd->dev;
511 config.name = mtd->name; 512 config.name = mtd->name;
512 config.owner = THIS_MODULE; 513 config.owner = THIS_MODULE;
@@ -522,7 +523,7 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
522 mtd->nvmem = nvmem_register(&config); 523 mtd->nvmem = nvmem_register(&config);
523 if (IS_ERR(mtd->nvmem)) { 524 if (IS_ERR(mtd->nvmem)) {
524 /* Just ignore if there is no NVMEM support in the kernel */ 525 /* Just ignore if there is no NVMEM support in the kernel */
525 if (PTR_ERR(mtd->nvmem) == -ENOSYS) { 526 if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
526 mtd->nvmem = NULL; 527 mtd->nvmem = NULL;
527 } else { 528 } else {
528 dev_err(&mtd->dev, "Failed to register NVMEM device\n"); 529 dev_err(&mtd->dev, "Failed to register NVMEM device\n");