diff options
author | Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com> | 2011-12-06 17:18:12 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-08 17:22:09 -0500 |
commit | 33e638b9070ba5e8812836e20390da6a6af13900 (patch) | |
tree | 3352b34c01b8b99cda506eccb432ca6463cbb651 /include/linux/suspend.h | |
parent | 43753e58b16506f47bc2901e6a228445960b6ce7 (diff) |
PM / Sleep: Use the freezer_count() functions in [un]lock_system_sleep() APIs
Now that freezer_count() and freezer_do_not_count() don't have the restriction
that they are effective only when called by userspace processes, use
them in lock_system_sleep() and unlock_system_sleep() instead of open-coding
their parts.
Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r-- | include/linux/suspend.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 1f7fff47cfac..906d62cfc15c 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #include <linux/init.h> | 6 | #include <linux/init.h> |
7 | #include <linux/pm.h> | 7 | #include <linux/pm.h> |
8 | #include <linux/mm.h> | 8 | #include <linux/mm.h> |
9 | #include <linux/freezer.h> | ||
9 | #include <asm/errno.h> | 10 | #include <asm/errno.h> |
10 | 11 | ||
11 | #ifdef CONFIG_VT | 12 | #ifdef CONFIG_VT |
@@ -380,16 +381,14 @@ static inline void unlock_system_sleep(void) {} | |||
380 | 381 | ||
381 | static inline void lock_system_sleep(void) | 382 | static inline void lock_system_sleep(void) |
382 | { | 383 | { |
383 | /* simplified freezer_do_not_count() */ | 384 | freezer_do_not_count(); |
384 | current->flags |= PF_FREEZER_SKIP; | ||
385 | mutex_lock(&pm_mutex); | 385 | mutex_lock(&pm_mutex); |
386 | } | 386 | } |
387 | 387 | ||
388 | static inline void unlock_system_sleep(void) | 388 | static inline void unlock_system_sleep(void) |
389 | { | 389 | { |
390 | mutex_unlock(&pm_mutex); | 390 | mutex_unlock(&pm_mutex); |
391 | /* simplified freezer_count() */ | 391 | freezer_count(); |
392 | current->flags &= ~PF_FREEZER_SKIP; | ||
393 | } | 392 | } |
394 | #endif | 393 | #endif |
395 | 394 | ||