Commit 95193796 authored by Michal Suchanek's avatar Michal Suchanek Committed by Brian Norris

mtd: m25p80: read in spi_max_transfer_size chunks

Take into account transfer size limitation of SPI master.
Signed-off-by: default avatarMichal Suchanek <hramrach@gmail.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
Acked-by: default avatarMichal Suchanek <hramrach@gmail.com>
Tested-by: default avatarMichal Suchanek <hramrach@gmail.com>
parent 26f9bcad
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment