summaryrefslogtreecommitdiff
path: root/kernel/power/main.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2014-06-13 20:30:35 (GMT)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-06-16 21:29:39 (GMT)
commita6e15a39048ec3229b9a53425f4384f55f6cc1b3 (patch)
treed1f8a005d2b6e85f781f2c9a4ba899614ec55ed8 /kernel/power/main.c
parent7171511eaec5bf23fb06078f59784a3a0626b38f (diff)
downloadlinux-a6e15a39048ec3229b9a53425f4384f55f6cc1b3.tar.xz
PM / hibernate: introduce "nohibernate" boot parameter
To support using kernel features that are not compatible with hibernation, this creates the "nohibernate" kernel boot parameter to disable both hibernation and resume. This allows hibernation support to be a boot-time choice instead of only a compile-time choice. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r--kernel/power/main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 573410d..8e90f33 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -300,13 +300,11 @@ static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr,
s += sprintf(s,"%s ", pm_states[i].label);
#endif
-#ifdef CONFIG_HIBERNATION
- s += sprintf(s, "%s\n", "disk");
-#else
+ if (hibernation_available())
+ s += sprintf(s, "disk ");
if (s != buf)
/* convert the last space to a newline */
*(s-1) = '\n';
-#endif
return (s - buf);
}