[PATCH 3/5] mtd: nand: omap: print error when ELM config failed

Sascha Hauer s.hauer at pengutronix.de
Fri Dec 11 03:15:31 EST 2020


ELM config can fail when ELM support is disabled. Let the user know
about it.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/mtd/nand/nand_omap_gpmc.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index 1d81500bce..8fdfd236bd 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -1128,8 +1128,11 @@ static int omap_gpmc_eccmode(struct gpmc_nand_info *oinfo,
 		err = elm_config(BCH16_ECC,
 				 minfo->writesize / nand->ecc.size,
 				 nand->ecc.size, nand->ecc.bytes);
-		if (err < 0)
+		if (err < 0) {
+			dev_err(oinfo->pdev, "ELM config failed: %s\n",
+				strerror(-err));
 			return err;
+		}
 
 		nand->ecc.read_page = gpmc_read_page_hwecc_elm;
 
-- 
2.20.1




More information about the barebox mailing list