diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2015-01-15 03:00:37 +0100 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-01-20 13:58:31 +0100 |
commit | faeed51bb65ce0241052d8dc24ac331ade12e976 (patch) | |
tree | 2d57bd6d3e6df6437956ba6ecde15fd058298fb6 /drivers/power/gpio-charger.c | |
parent | power: rt5033_battery: Add RT5033 Fuel gauge device driver (diff) | |
download | linux-faeed51bb65ce0241052d8dc24ac331ade12e976.tar.xz linux-faeed51bb65ce0241052d8dc24ac331ade12e976.zip |
power: gpio-charger: balance enable/disable_irq_wake calls
enable_irq_wakeup returns 0 in case it correctly enabled the IRQ to
generate the wakeup event (and thus resume should call disable_irq_wake).
Currently gpio-charger driver has this logic inverted. Correct that thus
correcting enable/disable_irq_wake() calls balance.
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/gpio-charger.c')
-rw-r--r-- | drivers/power/gpio-charger.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c index aef74bdf7ab3..b7424c8501f1 100644 --- a/drivers/power/gpio-charger.c +++ b/drivers/power/gpio-charger.c @@ -229,7 +229,7 @@ static int gpio_charger_suspend(struct device *dev) if (device_may_wakeup(dev)) gpio_charger->wakeup_enabled = - enable_irq_wake(gpio_charger->irq); + !enable_irq_wake(gpio_charger->irq); return 0; } @@ -239,7 +239,7 @@ static int gpio_charger_resume(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct gpio_charger *gpio_charger = platform_get_drvdata(pdev); - if (gpio_charger->wakeup_enabled) + if (device_may_wakeup(dev) && gpio_charger->wakeup_enabled) disable_irq_wake(gpio_charger->irq); power_supply_changed(&gpio_charger->charger); |