Commit 0c5ff0ef authored by Zhang Rui's avatar Zhang Rui Committed by Rafael J. Wysocki

PM / sleep: unregister wakeup source when disabling device wakeup

When enabling a device' wakeup capability, a wakeup source
is created for the device automatically. But the wakeup source
is not unregistered when disabling the device' wakeup capability.

This results in zombie wakeup sources, after devices/drivers are unregistered.
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 0399d4db
......@@ -318,10 +318,16 @@ int device_init_wakeup(struct device *dev, bool enable)
{
int ret = 0;
if (!dev)
return -EINVAL;
if (enable) {
device_set_wakeup_capable(dev, true);
ret = device_wakeup_enable(dev);
} else {
if (dev->power.can_wakeup)
device_wakeup_disable(dev);
device_set_wakeup_capable(dev, false);
}
......
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