mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] mtd: Notify user when erasure of a block failed during erase op
@ 2021-03-16 12:44 Stefan Riedmueller
  2021-03-17  9:47 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Riedmueller @ 2021-03-16 12:44 UTC (permalink / raw)
  To: barebox; +Cc: Stefan Riedmueller

Give the user information about the faulty block when an erase
operation fails with error.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
---
 drivers/mtd/core.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/core.c b/drivers/mtd/core.c
index af33ad665c5a..22eb2a056c4e 100644
--- a/drivers/mtd/core.c
+++ b/drivers/mtd/core.c
@@ -222,8 +222,11 @@ static int mtd_op_erase(struct cdev *cdev, loff_t count, loff_t offset)
 			printf("Skipping bad block at 0x%08llx\n", addr);
 		} else {
 			ret = mtd_erase(mtd, &erase);
-			if (ret)
+			if (ret) {
+				printf("%s: failed to erase block at 0x%08llx\n",
+					__func__, addr);
 				return ret;
+			}
 		}
 
 		addr += mtd->erasesize;
-- 
2.25.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


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

end of thread, other threads:[~2021-03-17  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 12:44 [PATCH] mtd: Notify user when erasure of a block failed during erase op Stefan Riedmueller
2021-03-17  9:47 ` Sascha Hauer

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