aboutsummaryrefslogtreecommitdiff
path: root/include/linux/suspend.h
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2009-12-22 17:21:47 -0700
committerDan Williams <dan.j.williams@intel.com>2009-12-22 17:21:47 -0700
commitf80ca163d65903276bec7045a484a79c0897eb2d (patch)
tree97c7d61d43248b9db0757a76af80ff58b98b5599 /include/linux/suspend.h
parent0794ec8ce327ec74416b569b8fb1951274693700 (diff)
parenta6d52d70677e99bdb89b6921c265d0a58c22e597 (diff)
Merge branch 'ioat' into fixes
Diffstat (limited to 'include/linux/suspend.h')
-rw-r--r--include/linux/suspend.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index cd15df6c63c..5e781d824e6 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -301,6 +301,8 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
#define pm_notifier(fn, pri) do { (void)(fn); } while (0)
#endif /* !CONFIG_PM_SLEEP */
+extern struct mutex pm_mutex;
+
#ifndef CONFIG_HIBERNATION
static inline void register_nosave_region(unsigned long b, unsigned long e)
{
@@ -308,8 +310,23 @@ static inline void register_nosave_region(unsigned long b, unsigned long e)
static inline void register_nosave_region_late(unsigned long b, unsigned long e)
{
}
-#endif
-extern struct mutex pm_mutex;
+static inline void lock_system_sleep(void) {}
+static inline void unlock_system_sleep(void) {}
+
+#else
+
+/* Let some subsystems like memory hotadd exclude hibernation */
+
+static inline void lock_system_sleep(void)
+{
+ mutex_lock(&pm_mutex);
+}
+
+static inline void unlock_system_sleep(void)
+{
+ mutex_unlock(&pm_mutex);
+}
+#endif
#endif /* _LINUX_SUSPEND_H */