aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2007-06-17 13:49:20 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:09:02 -0400
commit1c3f7d1c79425dd8f627b8da139fd1855f096b6e (patch)
tree36c39ee526bcefc6119b36798635db23cf467e1c
parent515c53576299e32d6bdb6295cfa2fe1307516eb4 (diff)
PM: Remove power_state.event checks from suspend core code
The suspend routines should be called for every device during a system sleep transition, regardless of the device's state, so that drivers can regard these method calls as notifications that the system is about to go to sleep, rather than as directives to put their devices into the 'off' state. This is documented in Documentation/power/devices.txt and is already done in the core resume code, so it seems reasonable to make the core suspend code behave accordingly. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/base/power/suspend.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/base/power/suspend.c b/drivers/base/power/suspend.c
index 5178b0fbd82e..a3ff3944832a 100644
--- a/drivers/base/power/suspend.c
+++ b/drivers/base/power/suspend.c
@@ -71,21 +71,19 @@ 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 if (dev->class && dev->class->suspend && !dev->power.power_state.event) { 74 if (dev->class && dev->class->suspend) {
75 suspend_device_dbg(dev, state, "class "); 75 suspend_device_dbg(dev, state, "class ");
76 error = dev->class->suspend(dev, state); 76 error = dev->class->suspend(dev, state);
77 suspend_report_result(dev->class->suspend, error); 77 suspend_report_result(dev->class->suspend, error);
78 } 78 }
79 79
80 if (!error && dev->type && dev->type->suspend 80 if (!error && dev->type && dev->type->suspend) {
81 && !dev->power.power_state.event) {
82 suspend_device_dbg(dev, state, "type "); 81 suspend_device_dbg(dev, state, "type ");
83 error = dev->type->suspend(dev, state); 82 error = dev->type->suspend(dev, state);
84 suspend_report_result(dev->type->suspend, error); 83 suspend_report_result(dev->type->suspend, error);
85 } 84 }
86 85
87 if (!error && dev->bus && dev->bus->suspend 86 if (!error && dev->bus && dev->bus->suspend) {
88 && !dev->power.power_state.event) {
89 suspend_device_dbg(dev, state, ""); 87 suspend_device_dbg(dev, state, "");
90 error = dev->bus->suspend(dev, state); 88 error = dev->bus->suspend(dev, state);
91 suspend_report_result(dev->bus->suspend, error); 89 suspend_report_result(dev->bus->suspend, error);
@@ -104,8 +102,7 @@ static int suspend_device_late(struct device *dev, pm_message_t state)
104{ 102{
105 int error = 0; 103 int error = 0;
106 104
107 if (dev->bus && dev->bus->suspend_late 105 if (dev->bus && dev->bus->suspend_late) {
108 && !dev->power.power_state.event) {
109 suspend_device_dbg(dev, state, "LATE "); 106 suspend_device_dbg(dev, state, "LATE ");
110 error = dev->bus->suspend_late(dev, state); 107 error = dev->bus->suspend_late(dev, state);
111 suspend_report_result(dev->bus->suspend_late, error); 108 suspend_report_result(dev->bus->suspend_late, error);