diff options
Diffstat (limited to 'kernel/power/disk.c')
-rw-r--r-- | kernel/power/disk.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 77ac605bf20a..885c653509c9 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -205,12 +205,23 @@ int hibernation_restore(int platform_mode) | |||
205 | 205 | ||
206 | int hibernation_platform_enter(void) | 206 | int hibernation_platform_enter(void) |
207 | { | 207 | { |
208 | int error; | ||
209 | |||
208 | if (hibernation_ops) { | 210 | if (hibernation_ops) { |
209 | kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); | 211 | kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); |
210 | return hibernation_ops->enter(); | 212 | /* |
213 | * We have cancelled the power transition by running | ||
214 | * hibernation_ops->finish() before saving the image, so we | ||
215 | * should let the firmware know that we're going to enter the | ||
216 | * sleep state after all | ||
217 | */ | ||
218 | error = hibernation_ops->prepare(); | ||
219 | if (!error) | ||
220 | error = hibernation_ops->enter(); | ||
211 | } else { | 221 | } else { |
212 | return -ENOSYS; | 222 | error = -ENOSYS; |
213 | } | 223 | } |
224 | return error; | ||
214 | } | 225 | } |
215 | 226 | ||
216 | /** | 227 | /** |