Skip to content

Commit

Permalink
[PATCH] swpsuspend: Have suspend to disk use factors of sys_reboot
Browse files Browse the repository at this point in the history
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: Eric W. Biederman <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ebiederm authored and Linus Torvalds committed Jul 26, 2005
1 parent 804ebf4 commit fdde86a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,13 @@ static void power_down(suspend_disk_method_t mode)
error = pm_ops->enter(PM_SUSPEND_DISK);
break;
case PM_DISK_SHUTDOWN:
printk("Powering off system\n");
device_shutdown();
machine_power_off();
kernel_power_off();
break;
case PM_DISK_REBOOT:
device_shutdown();
machine_restart(NULL);
kernel_restart(NULL);
break;
}
machine_halt();
kernel_halt();
/* Valid image is on the disk, if we continue we risk serious data corruption
after resume. */
printk(KERN_CRIT "Please power me down manually\n");
Expand Down

0 comments on commit fdde86a

Please sign in to comment.