summaryrefslogtreecommitdiff
path: root/net/rfkill/rfkill-gpio.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-06-01 03:34:26 +0300
committerDavid S. Miller <davem@davemloft.net>2015-06-01 03:34:26 +0300
commitd80373146261326eb207cf98bbdbe33c8c569134 (patch)
treece6c92e81dab53cf51767ebfdaebcd4f8ace2860 /net/rfkill/rfkill-gpio.c
parenta9ab2184f451ec78af245ebb8b663d8700d44672 (diff)
parentf7959e9c73200f2ae361d0d311aa501f2c6a05c7 (diff)
downloadlinux-d80373146261326eb207cf98bbdbe33c8c569134.tar.xz
Merge tag 'mac80211-next-for-davem-2015-05-29' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says: ==================== As we get closer to the merge window, here are a few more things for -next: * disconnect TDLS stations on CSA to avoid issues * fix a memory leak introduced in a recent commit * switch rfkill and cfg80211 to PM ops * in an unlikely scenario, prevent a bookkeeping value to get corrupted leading to dropped packets * fix a crash in VLAN assignment * switch rfkill-gpio to more modern gpiod API * send disconnected event to userspace with proper local/remote indication ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rfkill/rfkill-gpio.c')
-rw-r--r--net/rfkill/rfkill-gpio.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index d978f2f46ff3..d5d58d919552 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -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