summaryrefslogtreecommitdiffstats
path: root/net/rfkill/rfkill-gpio.c
diff options
context:
space:
mode:
authorJohn W. Linville <linville@tuxdriver.com>2014-05-22 13:58:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-05-22 13:58:36 -0400
commit40a10fd740a4d5a9f3da255cf8dae48c6723d1a6 (patch)
treea65eb4adca8e37ed7335345e94e36918593f7f92 /net/rfkill/rfkill-gpio.c
parent99abe65ff18b6bbac2e55524827b571c3eccfa86 (diff)
parent67af9811539be83dbdc0739215d29af23c870405 (diff)
downloadlinux-40a10fd740a4d5a9f3da255cf8dae48c6723d1a6.tar.bz2
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'net/rfkill/rfkill-gpio.c')
-rw-r--r--net/rfkill/rfkill-gpio.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c
index 9c4a5eb91cbf..14c98e48f261 100644
--- a/net/rfkill/rfkill-gpio.c
+++ b/net/rfkill/rfkill-gpio.c
@@ -45,17 +45,14 @@ static int rfkill_gpio_set_power(void *data, bool blocked)
{
struct rfkill_gpio_data *rfkill = data;
- if (blocked) {
- gpiod_set_value(rfkill->shutdown_gpio, 0);
- gpiod_set_value(rfkill->reset_gpio, 0);
- if (!IS_ERR(rfkill->clk) && rfkill->clk_enabled)
- clk_disable(rfkill->clk);
- } else {
- if (!IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
- clk_enable(rfkill->clk);
- gpiod_set_value(rfkill->reset_gpio, 1);
- gpiod_set_value(rfkill->shutdown_gpio, 1);
- }
+ if (!blocked && !IS_ERR(rfkill->clk) && !rfkill->clk_enabled)
+ clk_enable(rfkill->clk);
+
+ gpiod_set_value_cansleep(rfkill->shutdown_gpio, !blocked);
+ gpiod_set_value_cansleep(rfkill->reset_gpio, !blocked);
+
+ if (blocked && !IS_ERR(rfkill->clk) && rfkill->clk_enabled)
+ clk_disable(rfkill->clk);
rfkill->clk_enabled = blocked;