From: Tudor Ambarus Date: Sat, 2 Nov 2019 11:23:44 +0000 (+0000) Subject: mtd: spi-nor: Print debug message when the read back test fails X-Git-Tag: v5.5-rc1~196^2~1^2~11 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=b24eaf5f23754cbfc80f3077440acaafc9551290;p=linux.git mtd: spi-nor: Print debug message when the read back test fails Demystify where the EIO error occurs. Signed-off-by: Tudor Ambarus Reviewed-by: Vignesh Raghavendra --- 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; } /**