提交 95193796 编写于 作者: M Michal Suchanek 提交者: Brian Norris

mtd: m25p80: read in spi_max_transfer_size chunks

Take into account transfer size limitation of SPI master.
Signed-off-by: NMichal Suchanek <hramrach@gmail.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Acked-by: NMichal Suchanek <hramrach@gmail.com>
Tested-by: NMichal Suchanek <hramrach@gmail.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册