[PATCH v2 3/4] mtd: nand: mxc_nand: Add error message if BBT creation fails
Uwe Kleine-König
u.kleine-koenig at pengutronix.de
Mon May 6 07:46:10 PDT 2024
Then reading from the chip and thus aborting creation of a bad block
table, at inform the user about that with an error message.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
---
drivers/mtd/nand/raw/mxc_nand.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/raw/mxc_nand.c b/drivers/mtd/nand/raw/mxc_nand.c
index 8e564fa76a33..faea1c95f95e 100644
--- a/drivers/mtd/nand/raw/mxc_nand.c
+++ b/drivers/mtd/nand/raw/mxc_nand.c
@@ -1569,8 +1569,11 @@ static int checkbad(struct mtd_info *mtd, loff_t ofs)
};
ret = mtd_read_oob(mtd, ofs, &ops);
- if (ret < 0)
+ if (ret < 0) {
+ dev_err(mtd->dev.parent, "Failed to read page at 0x%08x\n",
+ (unsigned int)ofs);
return ret;
+ }
if (buf[2000] != 0xff)
/* block considered bad */
--
2.43.0
More information about the barebox
mailing list