PM: Split up sysdev_[suspend|resume] from device_power_[down|up]

Move the sysdev_suspend/resume from the callee to the callers, with
no real change in semantics, so that we can rework the disabling of
interrupts during suspend/hibernation.

This is based on an earlier patch from Linus.

Signed-off-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Rafael J. Wysocki 2009-02-22 18:38:50 +01:00 • committed by Linus Torvalds
commit 770824bdc4
8 changed files with 38 additions and 7 deletions

View file

@ -45,6 +45,13 @@ static int xen_suspend(void *data)
err);
return err;
}
err = sysdev_suspend(PMSG_SUSPEND);
if (err) {
printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n",
err);
device_power_up(PMSG_RESUME);
return err;
}
xen_mm_pin_all();
gnttab_suspend();
@ -61,6 +68,7 @@ static int xen_suspend(void *data)
gnttab_resume();
xen_mm_unpin_all();
sysdev_resume();
device_power_up(PMSG_RESUME);
if (!*cancelled) {