]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'spi/topic/armada', 'spi/topic/ath79', 'spi/topic...
authorMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:54:05 +0000 (15:54 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 12 Dec 2016 15:54:05 +0000 (15:54 +0000)
1  2  3  4  5 
drivers/spi/spi-atmel.c

index 9fb00ac3ac2ef023820df542bb4c1d70376dd547,8feac599e9ab4bfe886b8da89960f04ed32c1aba,8feac599e9ab4bfe886b8da89960f04ed32c1aba,3e537ed5cd75a9ed8a1740a424aedf7319d6dd16,8feac599e9ab4bfe886b8da89960f04ed32c1aba..0e7712bac3b6e1411e49890a5668c068371631f0
@@@@@@ -1491,39 -1499,6 -1499,6 -1429,39 -1499,6 +1430,39 @@@@@@ static void atmel_get_caps(struct atmel
     }
     
     /*-------------------------------------------------------------------------*/
-                       if (cs_gpio == -EPROBE_DEFER)
-                               return cs_gpio;
 ++ +static int atmel_spi_gpio_cs(struct platform_device *pdev)
 ++ +{
 ++ +   struct spi_master       *master = platform_get_drvdata(pdev);
 ++ +   struct atmel_spi        *as = spi_master_get_devdata(master);
 ++ +   struct device_node      *np = master->dev.of_node;
 ++ +   int                     i;
 ++ +   int                     ret = 0;
 ++ +   int                     nb = 0;
 ++ +
 ++ +   if (!as->use_cs_gpios)
 ++ +           return 0;
 ++ +
 ++ +   if (!np)
 ++ +           return 0;
 ++ +
 ++ +   nb = of_gpio_named_count(np, "cs-gpios");
 ++ +   for (i = 0; i < nb; i++) {
 ++ +           int cs_gpio = of_get_named_gpio(pdev->dev.of_node,
 ++ +                                           "cs-gpios", i);
 ++ +
-                       if (gpio_is_valid(cs_gpio)) {
-                               ret = devm_gpio_request(&pdev->dev, cs_gpio,
-                                                       dev_name(&pdev->dev));
-                               if (ret)
-                                       return ret;
-                       }
+++ +           if (cs_gpio == -EPROBE_DEFER)
+++ +                   return cs_gpio;
 ++ +
+++ +           if (gpio_is_valid(cs_gpio)) {
+++ +                   ret = devm_gpio_request(&pdev->dev, cs_gpio,
+++ +                                           dev_name(&pdev->dev));
+++ +                   if (ret)
+++ +                           return ret;
+++ +           }
 ++ +   }
 ++ +
 ++ +   return 0;
 ++ +}
     
     static int atmel_spi_probe(struct platform_device *pdev)
     {