diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-04-09 09:55:48 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-04-27 15:19:19 +0200 |
commit | 771f1ca3ffe10871893751ab384de3b7a9b06610 (patch) | |
tree | b9b095a1fa53905ed11ac67578d903097ab2ae21 /target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch | |
parent | 1de74df8b9bbaafd147a2380fa306140b79b60d9 (diff) | |
download | upstream-771f1ca3ffe10871893751ab384de3b7a9b06610.tar.gz upstream-771f1ca3ffe10871893751ab384de3b7a9b06610.tar.bz2 upstream-771f1ca3ffe10871893751ab384de3b7a9b06610.zip |
brcm63xx: remove linux 4.4 support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch')
-rw-r--r-- | target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch b/target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch deleted file mode 100644 index fb89b77072..0000000000 --- a/target/linux/brcm63xx/patches-4.4/000-4.8-02-mtd-m25p80-return-amount-of-data-transferred-or-erro.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 1992297b0810a42d78ec7b4de15304eb0489fd97 Mon Sep 17 00:00:00 2001 -From: Michal Suchanek <hramrach@gmail.com> -Date: Thu, 5 May 2016 17:31:48 -0700 -Subject: [PATCH 02/10] mtd: m25p80: return amount of data transferred or error - in read/write - -Add checking of SPI transfer errors and return them from read/write -functions. Also return the amount of data transferred. - -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> ---- - drivers/mtd/devices/m25p80.c | 29 +++++++++++++++++++++-------- - 1 file changed, 21 insertions(+), 8 deletions(-) - ---- a/drivers/mtd/devices/m25p80.c -+++ b/drivers/mtd/devices/m25p80.c -@@ -81,6 +81,7 @@ static ssize_t m25p80_write(struct spi_n - struct spi_transfer t[2] = {}; - struct spi_message m; - int cmd_sz = m25p_cmdsz(nor); -+ ssize_t ret; - - spi_message_init(&m); - -@@ -98,10 +99,15 @@ static ssize_t m25p80_write(struct spi_n - t[1].len = len; - spi_message_add_tail(&t[1], &m); - -- spi_sync(spi, &m); -+ ret = spi_sync(spi, &m); -+ if (ret) -+ return ret; - -- *retlen += m.actual_length - cmd_sz; -- return 0; -+ ret = m.actual_length - cmd_sz; -+ if (ret < 0) -+ return -EIO; -+ *retlen += ret; -+ return ret; - } - - static inline unsigned int m25p80_rx_nbits(struct spi_nor *nor) -@@ -128,13 +134,13 @@ static ssize_t m25p80_read(struct spi_no - struct spi_transfer t[2]; - struct spi_message m; - unsigned int dummy = nor->read_dummy; -+ ssize_t ret; - - /* convert the dummy cycles to the number of bytes */ - dummy /= 8; - - if (spi_flash_read_supported(spi)) { - struct spi_flash_read_message msg; -- int ret; - - memset(&msg, 0, sizeof(msg)); - -@@ -151,7 +157,9 @@ static ssize_t m25p80_read(struct spi_no - - ret = spi_flash_read(spi, &msg); - *retlen = msg.retlen; -- return ret; -+ if (ret < 0) -+ return ret; -+ return msg.retlen; - } - - spi_message_init(&m); -@@ -169,10 +177,15 @@ static ssize_t m25p80_read(struct spi_no - t[1].len = len; - spi_message_add_tail(&t[1], &m); - -- spi_sync(spi, &m); -+ ret = spi_sync(spi, &m); -+ if (ret) -+ return ret; - -- *retlen = m.actual_length - m25p_cmdsz(nor) - dummy; -- return 0; -+ ret = m.actual_length - m25p_cmdsz(nor) - dummy; -+ if (ret < 0) -+ return -EIO; -+ *retlen += ret; -+ return ret; - } - - static int m25p80_erase(struct spi_nor *nor, loff_t offset) |