Skip to content

Commit 5cab061

Browse files
committed
mtd: Avoid printing error messages on probe deferrals
There is no reason to complain about probe errors in case of deferrals. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Reviewed-by: Michael Walle <michael@walle.cc> Link: https://lore.kernel.org/linux-mtd/20230307192506.439532-1-miquel.raynal@bootlin.com
1 parent 1a7537a commit 5cab061

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/mtd/mtdcore.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,12 +536,11 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
536536
mtd->nvmem = nvmem_register(&config);
537537
if (IS_ERR(mtd->nvmem)) {
538538
/* Just ignore if there is no NVMEM support in the kernel */
539-
if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
539+
if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP)
540540
mtd->nvmem = NULL;
541-
} else {
542-
dev_err(&mtd->dev, "Failed to register NVMEM device\n");
543-
return PTR_ERR(mtd->nvmem);
544-
}
541+
else
542+
return dev_err_probe(&mtd->dev, PTR_ERR(mtd->nvmem),
543+
"Failed to register NVMEM device\n");
545544
}
546545

547546
return 0;

0 commit comments

Comments
 (0)