aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2015-02-07 17:48:39 +0000
committerLuka Perkov <luka@openwrt.org>2015-02-07 17:48:39 +0000
commit383b0a6cce352f8caa04cab785edab771a586135 (patch)
tree4a8ef0a623215e73e14564e9b8a8b967e0a718b7 /target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch
parent6ca16eadc3a526b8eb7be1c57462bd7fc0f463d4 (diff)
downloadupstream-383b0a6cce352f8caa04cab785edab771a586135.tar.gz
upstream-383b0a6cce352f8caa04cab785edab771a586135.tar.bz2
upstream-383b0a6cce352f8caa04cab785edab771a586135.zip
ar71xx: refresh patches
Signed-off-by: Luka Perkov <luka@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44303 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch')
-rw-r--r--target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch18
1 files changed, 9 insertions, 9 deletions
diff --git a/target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch b/target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch
index 194b8becb4..d229b7f8df 100644
--- a/target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch
+++ b/target/linux/ar71xx/patches-3.14/406-mtd-m25p80-allow-to-specify-max-read-size.patch
@@ -43,8 +43,7 @@
+ size_t readlen;
+ size_t done;
+ int ret;
-
-- spi_sync(flash->spi, &m);
++
+ ret = wait_till_ready(flash);
+ if (ret) {
+ mutex_unlock(&flash->lock);
@@ -56,32 +55,33 @@
+ readlen = flash->max_read_len;
+ else
+ readlen = len;
-
-- *retlen = m.actual_length - m25p_cmdsz(flash) - dummy;
++
+ t[1].rx_buf = buf + ofs;
+ t[1].rx_nbits = m25p80_rx_nbits(flash);
+ t[1].len = readlen;
-
++
+ m25p_addr2cmd(flash, from + ofs, flash->command);
+
+ spi_sync(flash->spi, &m);
-+
+
+- spi_sync(flash->spi, &m);
+ done = m.actual_length - m25p_cmdsz(flash) -
+ dummy;
+ if (done != readlen) {
+ mutex_unlock(&flash->lock);
+ return 1;
+ }
-+
+
+- *retlen = m.actual_length - m25p_cmdsz(flash) - dummy;
+ ofs += done;
+ len -= done;
+ }
-+
+
+ *retlen = ofs;
mutex_unlock(&flash->lock);
return 0;
-@@ -1193,6 +1217,12 @@ static int m25p_probe(struct spi_device
+@@ -1193,6 +1217,12 @@ static int m25p_probe(struct spi_device
flash->mtd._unlock = m25p80_unlock;
}