Commit 5cab0615 authored by Miquel Raynal's avatar Miquel Raynal
Browse files

mtd: Avoid printing error messages on probe deferrals



There is no reason to complain about probe errors in case of deferrals.

Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarMichael Walle <michael@walle.cc>
Link: https://lore.kernel.org/linux-mtd/20230307192506.439532-1-miquel.raynal@bootlin.com
parent 1a7537a3
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -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;