Signed-off-by: Zhao, Gang <gang.zhao...@gmail.com>
---
 ...pi-ath79-make-chipselect-logic-more-flexible.patch | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git 
a/target/linux/ar71xx/patches-3.14/206-spi-ath79-make-chipselect-logic-more-flexible.patch
 
b/target/linux/ar71xx/patches-3.14/206-spi-ath79-make-chipselect-logic-more-flexible.patch
index b57dd5d..064382f 100644
--- 
a/target/linux/ar71xx/patches-3.14/206-spi-ath79-make-chipselect-logic-more-flexible.patch
+++ 
b/target/linux/ar71xx/patches-3.14/206-spi-ath79-make-chipselect-logic-more-flexible.patch
@@ -270,17 +270,7 @@ Signed-off-by: Gabor Juhos <juh...@openwrt.org>
        }
  }
  
-@@ -155,6 +178,9 @@ static int ath79_spi_setup(struct spi_de
- {
-       int status = 0;
- 
-+      if (spi->controller_data == NULL)
-+              return -EINVAL;
-+
-       if (spi->bits_per_word > 32)
-               return -EINVAL;
- 
-@@ -215,6 +241,10 @@ static int ath79_spi_probe(struct platfo
+@@ -212,6 +235,10 @@ static int ath79_spi_probe(struct platfo
        unsigned long rate;
        int ret;
  
@@ -291,12 +281,13 @@ Signed-off-by: Gabor Juhos <juh...@openwrt.org>
        master = spi_alloc_master(&pdev->dev, sizeof(*sp));
        if (master == NULL) {
                dev_err(&pdev->dev, "failed to allocate spi master\n");
-@@ -224,14 +254,10 @@ static int ath79_spi_probe(struct platfo
+@@ -221,15 +248,11 @@ static int ath79_spi_probe(struct platfo
        sp = spi_master_get_devdata(master);
        platform_set_drvdata(pdev, sp);
  
--      pdata = pdev->dev.platform_data;
+-      pdata = dev_get_platdata(&pdev->dev);
 -
+       master->bits_per_word_mask = SPI_BPW_RANGE_MASK(1, 32);
        master->setup = ath79_spi_setup;
        master->cleanup = ath79_spi_cleanup;
 -      if (pdata) {
@@ -306,5 +297,5 @@ Signed-off-by: Gabor Juhos <juh...@openwrt.org>
 +      master->bus_num = pdata->bus_num;
 +      master->num_chipselect = pdata->num_chipselect;
  
-       sp->bitbang.master = spi_master_get(master);
+       sp->bitbang.master = master;
        sp->bitbang.chipselect = ath79_spi_chipselect;
-- 
1.9.3
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to