[PATCH] Revert "mtd: spi-nor: core: Return error code from set_4byte_addr_mode()"

Mika Westerberg mika.westerberg at linux.intel.com
Thu Sep 22 06:48:24 PDT 2022


This reverts commit 08412e72afba3a2daef3e7f3378c3753255a0017.

The Intel SPI-NOR controller does not support this opcode so the driver
ends up returning -EOPNOTSUPP and that makes the SPI flash chip probe
fail like this:

  [ 12.291082] spi-nor: probe of spi0.0 failed with error -524

Whereas previously it worked just fine (and hence the return value
probably was ignored in the first place).

Reported-by: Hongyu Ning <hongyu.ning at intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg at linux.intel.com>
Cc: stable at vger.kernel.org
---
 drivers/mtd/spi-nor/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index f2c64006f8d7..3af2fcf1f683 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -2724,7 +2724,7 @@ static int spi_nor_init(struct spi_nor *nor)
 		 */
 		WARN_ONCE(nor->flags & SNOR_F_BROKEN_RESET,
 			  "enabling reset hack; may not recover from unexpected reboots\n");
-		return nor->params->set_4byte_addr_mode(nor, true);
+		nor->params->set_4byte_addr_mode(nor, true);
 	}
 
 	return 0;
-- 
2.35.1




More information about the linux-mtd mailing list