aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Westerberg <[email protected]>2022-09-23 12:34:41 +0300
committerMiquel Raynal <[email protected]>2022-10-18 10:11:35 +0200
commit69d04ca999499bccb6ca849fa2bfc5e6448f7233 (patch)
treed979a0ed720468400d1f08e08b840fb608e1f2cd
parent9abf2313adc1ca1b6180c508c25f22f9395cc780 (diff)
mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init()
The Intel SPI-NOR controller does not support the 4-byte address opcode so ->set_4byte_addr_mode() ends up returning -ENOTSUPP and the SPI flash chip probe fail like this: [ 12.291082] spi-nor: probe of spi0.0 failed with error -524 Whereas previously before commit 08412e72afba ("mtd: spi-nor: core: Return error code from set_4byte_addr_mode()") it worked just fine. Fix this by ignoring -ENOTSUPP in spi_nor_init(). Fixes: 08412e72afba ("mtd: spi-nor: core: Return error code from set_4byte_addr_mode()") Cc: [email protected] Reported-by: Hongyu Ning <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Reviewed-by: Michael Walle <[email protected]> Acked-by: Tudor Ambarus <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
-rw-r--r--drivers/mtd/spi-nor/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index f2c64006f8d7..bee8fc4c9f07 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -2724,7 +2724,9 @@ 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);
+ err = nor->params->set_4byte_addr_mode(nor, true);
+ if (err && err != -ENOTSUPP)
+ return err;
}
return 0;