aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-06-17 13:48:06 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:02 -0400
commit515c53576299e32d6bdb6295cfa2fe1307516eb4 (patch)
tree210def9ddfced2800dc014a49a6f6a37dbf795eb
parent2a0134554e12f530c6eccb1dab3f0f8954f855c9 (diff)
PM: Remove prev_state from struct dev_pm_info
The prev_state member of struct dev_pm_info (defined in include/linux/pm.h) is only used during a resume to check if the device's state before the suspend was 'off', in which case the device is not resumed. However, in such cases the decision whether or not to resume the device should be made on the driver level and the resume callbacks from the device's bus and class should be executed anyway (the may be needed for some things other than just powering on the device). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/base/power/resume.c3
-rw-r--r--drivers/base/power/suspend.c2
-rw-r--r--drivers/usb/core/hub.c5
-rw-r--r--include/linux/pm.h1
4 files changed, 1 insertions, 10 deletions
diff --git a/drivers/base/power/resume.c b/drivers/base/power/resume.c
index 99679e7a6cc6..0c9610688542 100644
--- a/drivers/base/power/resume.c
+++ b/drivers/base/power/resume.c
@@ -88,8 +88,7 @@ void dpm_resume(void)
88 list_move_tail(entry, &dpm_active); 88 list_move_tail(entry, &dpm_active);
89 89
90 mutex_unlock(&dpm_list_mtx); 90 mutex_unlock(&dpm_list_mtx);
91 if (!dev->power.prev_state.event) 91 resume_device(dev);
92 resume_device(dev);
93 mutex_lock(&dpm_list_mtx); 92 mutex_lock(&dpm_list_mtx);
94 put_device(dev); 93 put_device(dev);
95 } 94 }
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index af2cedfbc1b4..5178b0fbd82e 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -71,8 +71,6 @@ int suspend_device(struct device * dev, pm_message_t state)
71 dev->parent->power.power_state.event); 71 dev->parent->power.power_state.event);
72 } 72 }
73 73
74 dev->power.prev_state = dev->power.power_state;
75
76 if (dev->class && dev->class->suspend && !dev->power.power_state.event) { 74 if (dev->class && dev->class->suspend && !dev->power.power_state.event) {
77 suspend_device_dbg(dev, state, "class "); 75 suspend_device_dbg(dev, state, "class ");
78 error = dev->class->suspend(dev, state); 76 error = dev->class->suspend(dev, state);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 24f10a19dbdb..a9cf8b30bccc 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1109,11 +1109,6 @@ void usb_root_hub_lost_power(struct usb_device *rhdev)
1109 1109
1110 dev_warn(&rhdev->dev, "root hub lost power or was reset\n"); 1110 dev_warn(&rhdev->dev, "root hub lost power or was reset\n");
1111 1111
1112 /* Make sure no potential wakeup events get lost,
1113 * by forcing the root hub to be resumed.
1114 */
1115 rhdev->dev.power.prev_state.event = PM_EVENT_ON;
1116
1117 spin_lock_irqsave(&device_state_lock, flags); 1112 spin_lock_irqsave(&device_state_lock, flags);
1118 hub = hdev_to_hub(rhdev); 1113 hub = hdev_to_hub(rhdev);
1119 for (port1 = 1; port1 <= rhdev->maxchild; ++port1) { 1114 for (port1 = 1; port1 <= rhdev->maxchild; ++port1) {
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 6e7f06671683..273781c82e4d 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -267,7 +267,6 @@ struct dev_pm_info {
267 unsigned can_wakeup:1; 267 unsigned can_wakeup:1;
268#ifdef CONFIG_PM 268#ifdef CONFIG_PM
269 unsigned should_wakeup:1; 269 unsigned should_wakeup:1;
270 pm_message_t prev_state;
271 struct list_head entry; 270 struct list_head entry;
272#endif 271#endif
273}; 272};