PM: wakelocks: Don't report wake up wakelock if suspend aborted
authorTodd Poynor <toddpoynor@google.com>
Tue, 9 Aug 2011 00:26:49 +0000 (17:26 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:22:35 +0000 (12:22 -0800)
If the wakelock driver aborts suspend due to an already-held
wakelock, don't report the next wakelock held as the "wake up
wakelock".

Change-Id: I582ffbb87a3c361739a77d839a0c62921cff11a6
Signed-off-by: Todd Poynor <toddpoynor@google.com>
kernel/power/wakelock.c

index c10d0ee..d45df2b 100644 (file)
@@ -311,7 +311,7 @@ static int power_suspend_late(struct device *dev)
 {
        int ret = has_wake_lock(WAKE_LOCK_SUSPEND) ? -EAGAIN : 0;
 #ifdef CONFIG_WAKELOCK_STAT
-       wait_for_wakeup = 1;
+       wait_for_wakeup = !ret;
 #endif
        if (debug_mask & DEBUG_SUSPEND)
                pr_info("power_suspend_late return %d\n", ret);