diff options
Diffstat (limited to 'drivers/acpi/sleep')
-rw-r--r-- | drivers/acpi/sleep/main.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index fdd8139b3f98..198ff8a1529a 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c | |||
@@ -91,10 +91,13 @@ static int acpi_pm_begin(suspend_state_t pm_state) | |||
91 | 91 | ||
92 | static int acpi_pm_prepare(void) | 92 | static int acpi_pm_prepare(void) |
93 | { | 93 | { |
94 | int error = acpi_sleep_prepare(acpi_target_sleep_state); | 94 | int error; |
95 | 95 | ||
96 | error = acpi_sleep_prepare(acpi_target_sleep_state); | ||
96 | if (error) | 97 | if (error) |
97 | acpi_target_sleep_state = ACPI_STATE_S0; | 98 | acpi_target_sleep_state = ACPI_STATE_S0; |
99 | else if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes())) | ||
100 | error = -EFAULT; | ||
98 | 101 | ||
99 | return error; | 102 | return error; |
100 | } | 103 | } |
@@ -261,7 +264,16 @@ static int acpi_hibernation_start(void) | |||
261 | 264 | ||
262 | static int acpi_hibernation_prepare(void) | 265 | static int acpi_hibernation_prepare(void) |
263 | { | 266 | { |
264 | return acpi_sleep_prepare(ACPI_STATE_S4); | 267 | int error; |
268 | |||
269 | error = acpi_sleep_prepare(ACPI_STATE_S4); | ||
270 | if (error) | ||
271 | return error; | ||
272 | |||
273 | if (!ACPI_SUCCESS(acpi_hw_disable_all_gpes())) | ||
274 | error = -EFAULT; | ||
275 | |||
276 | return error; | ||
265 | } | 277 | } |
266 | 278 | ||
267 | static int acpi_hibernation_enter(void) | 279 | static int acpi_hibernation_enter(void) |
@@ -426,6 +438,7 @@ static void acpi_power_off_prepare(void) | |||
426 | { | 438 | { |
427 | /* Prepare to power off the system */ | 439 | /* Prepare to power off the system */ |
428 | acpi_sleep_prepare(ACPI_STATE_S5); | 440 | acpi_sleep_prepare(ACPI_STATE_S5); |
441 | acpi_hw_disable_all_gpes(); | ||
429 | } | 442 | } |
430 | 443 | ||
431 | static void acpi_power_off(void) | 444 | static void acpi_power_off(void) |