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
This commit is contained in:
Miquel Raynal 2023-03-07 20:25:06 +01:00
parent 1a7537a39b
commit 5cab06156a
1 changed files with 4 additions and 5 deletions

View File

@ -536,12 +536,11 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
mtd->nvmem = nvmem_register(&config);
if (IS_ERR(mtd->nvmem)) {
/* Just ignore if there is no NVMEM support in the kernel */
if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP)
mtd->nvmem = NULL;
} else {
dev_err(&mtd->dev, "Failed to register NVMEM device\n");
return PTR_ERR(mtd->nvmem);
}
else
return dev_err_probe(&mtd->dev, PTR_ERR(mtd->nvmem),
"Failed to register NVMEM device\n");
}
return 0;