]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
mtd: spi-nor: Print debug message when the read back test fails
authorTudor Ambarus <tudor.ambarus@microchip.com>
Sat, 2 Nov 2019 11:23:44 +0000 (11:23 +0000)
committerTudor Ambarus <tudor.ambarus@microchip.com>
Thu, 7 Nov 2019 06:18:28 +0000 (08:18 +0200)
Demystify where the EIO error occurs.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
drivers/mtd/spi-nor/spi-nor.c

index 4616eb4422a3d8bebf5f4e01066bd2eddccb1680..9960e09136cedd3fe12b40a198654f4d795a5448 100644 (file)
@@ -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;
 }
 
 /**