PM: Abort suspend if wake_lock is acquired
[linux-2.6.git] / kernel / power / userwakelock.c
index a28a8db..e88c5da 100644 (file)
@@ -212,8 +212,13 @@ ssize_t wake_unlock_store(
                pr_info("wake_unlock_store: %s\n", l->name);
 
        wake_unlock(&l->wake_lock);
+
 not_found:
        mutex_unlock(&tree_lock);
+
+       if (!pm_wakeup_pending())
+               schedule_suspend_work();
+
        return n;
 }