diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2009-02-22 12:38:50 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-22 13:33:44 -0500 |
commit | 770824bdc421ff58a64db608294323571c949f4c (patch) | |
tree | 2fbeef604fe982bf322249a53a95dd2ff851d5f4 /drivers | |
parent | 936577c61d0c10b8929608a92c98d839b22053bc (diff) |
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 <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/base.h | 2 | ||||
-rw-r--r-- | drivers/base/power/main.c | 3 | ||||
-rw-r--r-- | drivers/xen/manage.c | 8 |
3 files changed, 8 insertions, 5 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 0a5f055dffba..9f50f1b545dc 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h | |||
@@ -88,8 +88,6 @@ extern void driver_detach(struct device_driver *drv); | |||
88 | extern int driver_probe_device(struct device_driver *drv, struct device *dev); | 88 | extern int driver_probe_device(struct device_driver *drv, struct device *dev); |
89 | 89 | ||
90 | extern void sysdev_shutdown(void); | 90 | extern void sysdev_shutdown(void); |
91 | extern int sysdev_suspend(pm_message_t state); | ||
92 | extern int sysdev_resume(void); | ||
93 | 91 | ||
94 | extern char *make_class_name(const char *name, struct kobject *kobj); | 92 | extern char *make_class_name(const char *name, struct kobject *kobj); |
95 | 93 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 670c9d6c1407..2d14f4ae6c01 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -333,7 +333,6 @@ static void dpm_power_up(pm_message_t state) | |||
333 | */ | 333 | */ |
334 | void device_power_up(pm_message_t state) | 334 | void device_power_up(pm_message_t state) |
335 | { | 335 | { |
336 | sysdev_resume(); | ||
337 | dpm_power_up(state); | 336 | dpm_power_up(state); |
338 | } | 337 | } |
339 | EXPORT_SYMBOL_GPL(device_power_up); | 338 | EXPORT_SYMBOL_GPL(device_power_up); |
@@ -577,8 +576,6 @@ int device_power_down(pm_message_t state) | |||
577 | } | 576 | } |
578 | dev->power.status = DPM_OFF_IRQ; | 577 | dev->power.status = DPM_OFF_IRQ; |
579 | } | 578 | } |
580 | if (!error) | ||
581 | error = sysdev_suspend(state); | ||
582 | if (error) | 579 | if (error) |
583 | dpm_power_up(resume_event(state)); | 580 | dpm_power_up(resume_event(state)); |
584 | return error; | 581 | return error; |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 9b91617b9582..56892a142ee2 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
@@ -45,6 +45,13 @@ static int xen_suspend(void *data) | |||
45 | err); | 45 | err); |
46 | return err; | 46 | return err; |
47 | } | 47 | } |
48 | err = sysdev_suspend(PMSG_SUSPEND); | ||
49 | if (err) { | ||
50 | printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", | ||
51 | err); | ||
52 | device_power_up(PMSG_RESUME); | ||
53 | return err; | ||
54 | } | ||
48 | 55 | ||
49 | xen_mm_pin_all(); | 56 | xen_mm_pin_all(); |
50 | gnttab_suspend(); | 57 | gnttab_suspend(); |
@@ -61,6 +68,7 @@ static int xen_suspend(void *data) | |||
61 | gnttab_resume(); | 68 | gnttab_resume(); |
62 | xen_mm_unpin_all(); | 69 | xen_mm_unpin_all(); |
63 | 70 | ||
71 | sysdev_resume(); | ||
64 | device_power_up(PMSG_RESUME); | 72 | device_power_up(PMSG_RESUME); |
65 | 73 | ||
66 | if (!*cancelled) { | 74 | if (!*cancelled) { |