diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2007-12-08 02:04:21 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-02-01 18:30:54 -0500 |
commit | 72df68ca8e006a0107933c4fb13c741a0a48163f (patch) | |
tree | c6d0d36bffc54989fffcebc8ec1368a47cfa6d65 /kernel/power/swsusp.c | |
parent | 2ed43b63285c394cb5e1829c199cc94c7b8233b9 (diff) |
Hibernation: Move low level resume to disk.c
Move the low level restore code to kernel/power/disk.c , since the
corresponding low level hibernation code is already there.
Make restore fail if device_power_down(PMSG_PRETHAW) returns an
error.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'kernel/power/swsusp.c')
-rw-r--r-- | kernel/power/swsusp.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c index 605c536795ba..dc29a20aff41 100644 --- a/kernel/power/swsusp.c +++ b/kernel/power/swsusp.c @@ -261,38 +261,3 @@ int swsusp_shrink_memory(void) return 0; } - -int swsusp_resume(void) -{ - int error; - - local_irq_disable(); - /* NOTE: device_power_down() is just a suspend() with irqs off; - * it has no special "power things down" semantics - */ - if (device_power_down(PMSG_PRETHAW)) - printk(KERN_ERR "Some devices failed to power down, very bad\n"); - /* We'll ignore saved state, but this gets preempt count (etc) right */ - save_processor_state(); - error = restore_highmem(); - if (!error) { - error = swsusp_arch_resume(); - /* The code below is only ever reached in case of a failure. - * Otherwise execution continues at place where - * swsusp_arch_suspend() was called - */ - BUG_ON(!error); - /* This call to restore_highmem() undos the previous one */ - restore_highmem(); - } - /* The only reason why swsusp_arch_resume() can fail is memory being - * very tight, so we have to free it as soon as we can to avoid - * subsequent failures - */ - swsusp_free(); - restore_processor_state(); - touch_softlockup_watchdog(); - device_power_up(); - local_irq_enable(); - return error; -} |