Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1395516 > unrolled thread

[PATCH v7 10/10] mtd: m25p80: read in spi_max_transfer_size chunks

Started byBrian Norris <computersforpeace@gmail.com>
First post2016-05-06 02:40 +0200
Last post2016-05-06 02:40 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v7 10/10] mtd: m25p80: read in spi_max_transfer_size chunks Brian Norris <computersforpeace@gmail.com> - 2016-05-06 02:40 +0200

#1395516 — [PATCH v7 10/10] mtd: m25p80: read in spi_max_transfer_size chunks

FromBrian Norris <computersforpeace@gmail.com>
Date2016-05-06 02:40 +0200
Subject[PATCH v7 10/10] mtd: m25p80: read in spi_max_transfer_size chunks
Message-ID<rvBYd-2li-1@gated-at.bofh.it>
From: Michal Suchanek <hramrach@gmail.com>

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>
---
v6 -> v7:
 * use min() instead of min_t()

 drivers/mtd/devices/m25p80.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.8.0.rc3.226.g39d4020

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web