aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@microchip.com>2019-11-02 11:23:44 +0000
committerTudor Ambarus <tudor.ambarus@microchip.com>2019-11-07 08:18:28 +0200
commitb24eaf5f23754cbfc80f3077440acaafc9551290 (patch)
treef4d00be74a48259b71b7348396ba4f796bea4b76 /drivers/mtd
parentmtd: spi-nor: Check all the bits written, not just the BP ones (diff)
downloadlinux-dev-b24eaf5f23754cbfc80f3077440acaafc9551290.tar.xz
linux-dev-b24eaf5f23754cbfc80f3077440acaafc9551290.zip
mtd: spi-nor: Print debug message when the read back test fails
Demystify where the EIO error occurs. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/spi-nor/spi-nor.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 4616eb4422a3..9960e09136ce 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -974,7 +974,12 @@ static int spi_nor_write_sr_and_check(struct spi_nor *nor, u8 status_new)
if (ret)
return ret;
- return (nor->bouncebuf[0] != status_new) ? -EIO : 0;
+ if (nor->bouncebuf[0] != status_new) {
+ dev_dbg(nor->dev, "SR: read back test failed\n");
+ return -EIO;
+ }
+
+ return 0;
}
/**