Commit fdde86ac authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds

[PATCH] swpsuspend: Have suspend to disk use factors of sys_reboot

The suspend to disk code was a poor copy of the code in
sys_reboot now that we have kernel_power_off, kernel_restart
and kernel_halt use them instead of poorly duplicating them inline.
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 804ebf46
...@@ -59,16 +59,13 @@ static void power_down(suspend_disk_method_t mode) ...@@ -59,16 +59,13 @@ static void power_down(suspend_disk_method_t mode)
error = pm_ops->enter(PM_SUSPEND_DISK); error = pm_ops->enter(PM_SUSPEND_DISK);
break; break;
case PM_DISK_SHUTDOWN: case PM_DISK_SHUTDOWN:
printk("Powering off system\n"); kernel_power_off();
device_shutdown();
machine_power_off();
break; break;
case PM_DISK_REBOOT: case PM_DISK_REBOOT:
device_shutdown(); kernel_restart(NULL);
machine_restart(NULL);
break; break;
} }
machine_halt(); kernel_halt();
/* Valid image is on the disk, if we continue we risk serious data corruption /* Valid image is on the disk, if we continue we risk serious data corruption
after resume. */ after resume. */
printk(KERN_CRIT "Please power me down manually\n"); printk(KERN_CRIT "Please power me down manually\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment