diff options
author | Dhruva Gole <d-gole@ti.com> | 2024-03-18 20:46:32 +0530 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-04-03 16:51:37 +0200 |
commit | afde996a33ee4dbe3692e1eff28b56c820331428 (patch) | |
tree | 05de50824c6fe40089f1fbc43a8aa781f21a69e4 /drivers/base/power | |
parent | 39cd87c4eb2b893354f3b850f916353f2658ae6f (diff) | |
download | linux-stable-afde996a33ee4dbe3692e1eff28b56c820331428.tar.gz linux-stable-afde996a33ee4dbe3692e1eff28b56c820331428.tar.bz2 linux-stable-afde996a33ee4dbe3692e1eff28b56c820331428.zip |
PM: wakeup: make device_wakeup_disable() return void
The device_wakeup_disable() call only returns an error if no dev exists,
but there's not much a user can do at that point.
Rather, make this function return void.
Signed-off-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/power')
-rw-r--r-- | drivers/base/power/wakeup.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index a917219feea6..752b417e8129 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c @@ -451,16 +451,15 @@ static struct wakeup_source *device_wakeup_detach(struct device *dev) * Detach the @dev's wakeup source object from it, unregister this wakeup source * object and destroy it. */ -int device_wakeup_disable(struct device *dev) +void device_wakeup_disable(struct device *dev) { struct wakeup_source *ws; if (!dev || !dev->power.can_wakeup) - return -EINVAL; + return; ws = device_wakeup_detach(dev); wakeup_source_unregister(ws); - return 0; } EXPORT_SYMBOL_GPL(device_wakeup_disable); @@ -502,7 +501,11 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_capable); */ int device_set_wakeup_enable(struct device *dev, bool enable) { - return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev); + if (enable) + return device_wakeup_enable(dev); + + device_wakeup_disable(dev); + return 0; } EXPORT_SYMBOL_GPL(device_set_wakeup_enable); |