diff mbox

PM / wakeup: Drop redundant check from device_set_wakeup_enable()

Message ID 2570001.kK8602TLGU@aspire.rjw.lan (mailing list archive)
State Mainlined
Delegated to: Rafael Wysocki
Headers show

Commit Message

Rafael J. Wysocki Dec. 26, 2017, 12:50 a.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since both device_wakeup_enable() and device_wakeup_disable() check
if dev is not NULL and whether or not power.can_wakeup is set for it,
device_set_wakeup_enable() doesn't have to do that, so drop that
check from it.

No intentional changes in functionality.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/base/power/wakeup.c |    3 ---
 1 file changed, 3 deletions(-)

Comments

Ulf Hansson Jan. 2, 2018, 1:44 p.m. UTC | #1
On 26 December 2017 at 01:50, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Since both device_wakeup_enable() and device_wakeup_disable() check
> if dev is not NULL and whether or not power.can_wakeup is set for it,
> device_set_wakeup_enable() doesn't have to do that, so drop that
> check from it.
>
> No intentional changes in functionality.
>
> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>

Kind regards
Uffe

> ---
>  drivers/base/power/wakeup.c |    3 ---
>  1 file changed, 3 deletions(-)
>
> Index: linux-pm/drivers/base/power/wakeup.c
> ===================================================================
> --- linux-pm.orig/drivers/base/power/wakeup.c
> +++ linux-pm/drivers/base/power/wakeup.c
> @@ -464,9 +464,6 @@ EXPORT_SYMBOL_GPL(device_init_wakeup);
>   */
>  int device_set_wakeup_enable(struct device *dev, bool enable)
>  {
> -       if (!dev || !dev->power.can_wakeup)
> -               return -EINVAL;
> -
>         return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev);
>  }
>  EXPORT_SYMBOL_GPL(device_set_wakeup_enable);
>
diff mbox

Patch

Index: linux-pm/drivers/base/power/wakeup.c
===================================================================
--- linux-pm.orig/drivers/base/power/wakeup.c
+++ linux-pm/drivers/base/power/wakeup.c
@@ -464,9 +464,6 @@  EXPORT_SYMBOL_GPL(device_init_wakeup);
  */
 int device_set_wakeup_enable(struct device *dev, bool enable)
 {
-	if (!dev || !dev->power.can_wakeup)
-		return -EINVAL;
-
 	return enable ? device_wakeup_enable(dev) : device_wakeup_disable(dev);
 }
 EXPORT_SYMBOL_GPL(device_set_wakeup_enable);