diff options
author | Kees Cook <keescook@chromium.org> | 2014-06-13 16:30:35 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-16 17:29:39 -0400 |
commit | a6e15a39048ec3229b9a53425f4384f55f6cc1b3 (patch) | |
tree | d1f8a005d2b6e85f781f2c9a4ba899614ec55ed8 /kernel/power/user.c | |
parent | 7171511eaec5bf23fb06078f59784a3a0626b38f (diff) |
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/user.c')
-rw-r--r-- | kernel/power/user.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 98d357584cd6..526e8911460a 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -49,6 +49,9 @@ static int snapshot_open(struct inode *inode, struct file *filp) | |||
49 | struct snapshot_data *data; | 49 | struct snapshot_data *data; |
50 | int error; | 50 | int error; |
51 | 51 | ||
52 | if (!hibernation_available()) | ||
53 | return -EPERM; | ||
54 | |||
52 | lock_system_sleep(); | 55 | lock_system_sleep(); |
53 | 56 | ||
54 | if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { | 57 | if (!atomic_add_unless(&snapshot_device_available, -1, 0)) { |