]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/rfkill/rfkill-gpio.c
Merge tag 'mac80211-next-for-davem-2015-05-29' of git://git.kernel.org/pub/scm/linux...
[karo-tx-linux.git] / net / rfkill / rfkill-gpio.c
index d978f2f46ff35e0181e2a833e3bfab2b6d58221e..d5d58d9195524f36b03bdac0125148cb7110901a 100644 (file)
@@ -112,21 +112,17 @@ static int rfkill_gpio_probe(struct platform_device *pdev)
 
        rfkill->clk = devm_clk_get(&pdev->dev, NULL);
 
-       gpio = devm_gpiod_get(&pdev->dev, "reset");
-       if (!IS_ERR(gpio)) {
-               ret = gpiod_direction_output(gpio, 0);
-               if (ret)
-                       return ret;
-               rfkill->reset_gpio = gpio;
-       }
+       gpio = devm_gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW);
+       if (IS_ERR(gpio))
+               return PTR_ERR(gpio);
 
-       gpio = devm_gpiod_get(&pdev->dev, "shutdown");
-       if (!IS_ERR(gpio)) {
-               ret = gpiod_direction_output(gpio, 0);
-               if (ret)
-                       return ret;
-               rfkill->shutdown_gpio = gpio;
-       }
+       rfkill->reset_gpio = gpio;
+
+       gpio = devm_gpiod_get_optional(&pdev->dev, "shutdown", GPIOD_OUT_LOW);
+       if (IS_ERR(gpio))
+               return PTR_ERR(gpio);
+
+       rfkill->shutdown_gpio = gpio;
 
        /* Make sure at-least one of the GPIO is defined and that
         * a name is specified for this instance