mtd: spi-nor: core: Ignore -ENOTSUPP in spi_nor_init()
authorMika Westerberg <mika.westerberg@linux.intel.com>
Fri, 23 Sep 2022 09:34:41 +0000 (12:34 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 18 Oct 2022 08:11:35 +0000 (10:11 +0200)
commit69d04ca999499bccb6ca849fa2bfc5e6448f7233
treed979a0ed720468400d1f08e08b840fb608e1f2cd
parent9abf2313adc1ca1b6180c508c25f22f9395cc780
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: stable@vger.kernel.org
Reported-by: Hongyu Ning <hongyu.ning@intel.com>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Acked-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20220923093441.3178-1-mika.westerberg@linux.intel.com
drivers/mtd/spi-nor/core.c