mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
b847dd96e6
commit
faeed51bb6
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue