Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: core: print error code if registering NVMEM fails
@ 2023-03-17  7:47 Rafał Miłecki
  2023-03-20 11:06 ` Miquel Raynal
  0 siblings, 1 reply; 3+ messages in thread
From: Rafał Miłecki @ 2023-03-17  7:47 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

It's a common practice that helps debugging problems.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/mtd/mtdcore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 83a22566a8ce..8303ce62c751 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -539,7 +539,8 @@ static int mtd_nvmem_add(struct mtd_info *mtd)
 		if (PTR_ERR(mtd->nvmem) == -EOPNOTSUPP) {
 			mtd->nvmem = NULL;
 		} else {
-			dev_err(&mtd->dev, "Failed to register NVMEM device\n");
+			dev_err(&mtd->dev, "Failed to register NVMEM device: %ld\n",
+				PTR_ERR(mtd->nvmem));
 			return PTR_ERR(mtd->nvmem);
 		}
 	}
-- 
2.34.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-03-20 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-17  7:47 [PATCH] mtd: core: print error code if registering NVMEM fails Rafał Miłecki
2023-03-20 11:06 ` Miquel Raynal
2023-03-20 11:21   ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox