diff options
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 6d295c776794..4d403323a7bb 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/pm.h> | 17 | #include <linux/pm.h> |
18 | #include <linux/console.h> | 18 | #include <linux/console.h> |
19 | #include <linux/cpu.h> | ||
19 | 20 | ||
20 | #include "power.h" | 21 | #include "power.h" |
21 | 22 | ||
@@ -51,7 +52,7 @@ void pm_set_ops(struct pm_ops * ops) | |||
51 | 52 | ||
52 | static int suspend_prepare(suspend_state_t state) | 53 | static int suspend_prepare(suspend_state_t state) |
53 | { | 54 | { |
54 | int error = 0; | 55 | int error; |
55 | unsigned int free_pages; | 56 | unsigned int free_pages; |
56 | 57 | ||
57 | if (!pm_ops || !pm_ops->enter) | 58 | if (!pm_ops || !pm_ops->enter) |
@@ -59,12 +60,9 @@ static int suspend_prepare(suspend_state_t state) | |||
59 | 60 | ||
60 | pm_prepare_console(); | 61 | pm_prepare_console(); |
61 | 62 | ||
62 | disable_nonboot_cpus(); | 63 | error = disable_nonboot_cpus(); |
63 | 64 | if (error) | |
64 | if (num_online_cpus() != 1) { | ||
65 | error = -EPERM; | ||
66 | goto Enable_cpu; | 65 | goto Enable_cpu; |
67 | } | ||
68 | 66 | ||
69 | if (freeze_processes()) { | 67 | if (freeze_processes()) { |
70 | error = -EAGAIN; | 68 | error = -EAGAIN; |