summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorMichal Suchanek <hramrach@gmail.com>2016-05-06 02:31:56 +0200
committerBrian Norris <computersforpeace@gmail.com>2016-06-02 02:23:06 +0200
commit95193796256cfce16e5d881318e15b6b04062c15 (patch)
treea9b87f3d12a58b40e56d148eddf71eecaf70c422 /drivers/mtd/devices
parentmtd: spi-nor: add read loop (diff)
downloadlinux-95193796256cfce16e5d881318e15b6b04062c15.tar.xz
linux-95193796256cfce16e5d881318e15b6b04062c15.zip
mtd: m25p80: read in spi_max_transfer_size chunks
Take into account transfer size limitation of SPI master. Signed-off-by: Michal Suchanek <hramrach@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> Acked-by: Michal Suchanek <hramrach@gmail.com> Tested-by: Michal Suchanek <hramrach@gmail.com>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/m25p80.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index eab46d211ae6..9cf7fcd28034 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -172,7 +172,7 @@ static ssize_t m25p80_read(struct spi_nor *nor, loff_t from, size_t len,
t[1].rx_buf = buf;
t[1].rx_nbits = m25p80_rx_nbits(nor);
- t[1].len = len;
+ t[1].len = min(len, spi_max_transfer_size(spi));
spi_message_add_tail(&t[1], &m);
ret = spi_sync(spi, &m);