diff mbox

PM / wakeup: Drop redundant check from device_init_wakeup()

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

Commit Message

Rafael J. Wysocki Jan. 2, 2018, 12:42 a.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Since device_wakeup_disable() checks the device's power.can_wakeup 
flag, device_init_wakeup() doesn't need to do that before calling it,
so drop that redundant check from device_init_wakeup().

No intentional changes in functionality.

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

Comments

Ulf Hansson Jan. 2, 2018, 1:44 p.m. UTC | #1
On 2 January 2018 at 01:42, Rafael J. Wysocki <rjw@rjwysocki.net> wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>
> Since device_wakeup_disable() checks the device's power.can_wakeup
> flag, device_init_wakeup() doesn't need to do that before calling it,
> so drop that redundant check from device_init_wakeup().
>
> 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 |    4 +---
>  1 file changed, 1 insertion(+), 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
> @@ -448,9 +448,7 @@ int device_init_wakeup(struct device *de
>                 device_set_wakeup_capable(dev, true);
>                 ret = device_wakeup_enable(dev);
>         } else {
> -               if (dev->power.can_wakeup)
> -                       device_wakeup_disable(dev);
> -
> +               device_wakeup_disable(dev);
>                 device_set_wakeup_capable(dev, false);
>         }
>
>
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
@@ -448,9 +448,7 @@  int device_init_wakeup(struct device *de
 		device_set_wakeup_capable(dev, true);
 		ret = device_wakeup_enable(dev);
 	} else {
-		if (dev->power.can_wakeup)
-			device_wakeup_disable(dev);
-
+		device_wakeup_disable(dev);
 		device_set_wakeup_capable(dev, false);
 	}