1
0

460-m25p80-spi-read-flash-check.patch 342 B

123456789101112131415
  1. --- a/drivers/mtd/devices/m25p80.c
  2. +++ b/drivers/mtd/devices/m25p80.c
  3. @@ -149,8 +149,10 @@ static int m25p80_read(struct spi_nor *n
  4. msg.data_nbits = m25p80_rx_nbits(nor);
  5. ret = spi_flash_read(spi, &msg);
  6. - *retlen = msg.retlen;
  7. - return ret;
  8. + if (!ret) {
  9. + *retlen = msg.retlen;
  10. + return 0;
  11. + }
  12. }
  13. spi_message_init(&m);