summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorTudor Ambarus <tudor.ambarus@microchip.com>2019-11-02 14:23:41 +0300
committerTudor Ambarus <tudor.ambarus@microchip.com>2019-11-07 09:18:27 +0300
commitb0db77f5aa0313561420c49acee66e94b33be6b6 (patch)
treef94ec27a617507eb9f4f85f9a61a5b98a2acece3 /drivers/mtd
parent6011b484f1647f2a944c87c31b2adee2a7c47f58 (diff)
downloadlinux-b0db77f5aa0313561420c49acee66e94b33be6b6.tar.xz
mtd: spi-nor: Fix errno on Quad Enable methods
When the Read-Modify-Write-Read-Back Quad Enable methods failed on the Read-Back, they returned -EINVAL. Since this is an I/O error, return -EIO. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
index 7510349b39f8..f5da752d2473 100644
--- a/drivers/mtd/spi-nor/spi-nor.c
+++ b/drivers/mtd/spi-nor/spi-nor.c
@@ -1964,7 +1964,7 @@ static int macronix_quad_enable(struct spi_nor *nor)
if (!(nor->bouncebuf[0] & SR_QUAD_EN_MX)) {
dev_dbg(nor->dev, "Macronix Quad bit not set\n");
- return -EINVAL;
+ return -EIO;
}
return 0;
@@ -2042,7 +2042,7 @@ static int spansion_read_cr_quad_enable(struct spi_nor *nor)
if (!(sr_cr[1] & CR_QUAD_EN_SPAN)) {
dev_dbg(nor->dev, "Spansion Quad bit not set\n");
- return -EINVAL;
+ return -EIO;
}
return 0;
@@ -2086,7 +2086,7 @@ static int sr2_bit7_quad_enable(struct spi_nor *nor)
if (!(*sr2 & SR2_QUAD_EN_BIT7)) {
dev_dbg(nor->dev, "SR2 Quad bit not set\n");
- return -EINVAL;
+ return -EIO;
}
return 0;