Commit faeed51b authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Sebastian Reichel

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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent b847dd96
...@@ -229,7 +229,7 @@ static int gpio_charger_suspend(struct device *dev) ...@@ -229,7 +229,7 @@ static int gpio_charger_suspend(struct device *dev)
if (device_may_wakeup(dev)) if (device_may_wakeup(dev))
gpio_charger->wakeup_enabled = gpio_charger->wakeup_enabled =
enable_irq_wake(gpio_charger->irq); !enable_irq_wake(gpio_charger->irq);
return 0; return 0;
} }
...@@ -239,7 +239,7 @@ static int gpio_charger_resume(struct device *dev) ...@@ -239,7 +239,7 @@ static int gpio_charger_resume(struct device *dev)
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct gpio_charger *gpio_charger = platform_get_drvdata(pdev); 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); disable_irq_wake(gpio_charger->irq);
power_supply_changed(&gpio_charger->charger); power_supply_changed(&gpio_charger->charger);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment