ar71xx: clean up spi controller related patches
[openwrt/openwrt.git] / target / linux / ar71xx / patches-4.4 / 460-m25p80-spi-read-flash-check.patch
diff --git a/target/linux/ar71xx/patches-4.4/460-m25p80-spi-read-flash-check.patch b/target/linux/ar71xx/patches-4.4/460-m25p80-spi-read-flash-check.patch
new file mode 100644 (file)
index 0000000..a34b383
--- /dev/null
@@ -0,0 +1,15 @@
+--- a/drivers/mtd/devices/m25p80.c
++++ b/drivers/mtd/devices/m25p80.c
+@@ -149,8 +149,10 @@ static int m25p80_read(struct spi_nor *n
+               msg.data_nbits = m25p80_rx_nbits(nor);
+               ret = spi_flash_read(spi, &msg);
+-              *retlen = msg.retlen;
+-              return ret;
++              if (!ret) {
++                      *retlen = msg.retlen;
++                      return 0;
++              }
+       }
+       spi_message_init(&m);