1 From: Felix Fietkau <nbd@nbd.name>
2 Date: Fri, 23 Feb 2018 17:12:16 +0100
3 Subject: [PATCH] mtd: m25p80: allow fallback from spi_flash_read to regular
6 Some flash controllers, e.g. on the ath79 platform can support a fast
7 flash read via memory mapping, but only if the flash chip is in
10 Since spi_flash_read_supported does not have access to the same data as
11 spi_flash_read, the driver can't detect an unsupported call until m25p80
12 has decided to use spi_flash_read.
14 Allow the driver to indicate a fallback to a regular SPI transfer by
17 Signed-off-by: Felix Fietkau <nbd@nbd.name>
20 --- a/drivers/mtd/devices/m25p80.c
21 +++ b/drivers/mtd/devices/m25p80.c
22 @@ -155,9 +155,11 @@ static ssize_t m25p80_read(struct spi_no
23 msg.data_nbits = m25p80_rx_nbits(nor);
25 ret = spi_flash_read(spi, &msg);
29 + if (ret != -EOPNOTSUPP) {