Преглед на файлове

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>
Rafael J. Wysocki преди 18 години
родител
ревизия
1c3f7d1c79
променени са 1 файла, в които са добавени 4 реда и са изтрити 7 реда
  1. 4 7
      drivers/base/power/suspend.c

+ 4 - 7
drivers/base/power/suspend.c

@@ -71,21 +71,19 @@ int suspend_device(struct device * dev, pm_message_t state)
 			dev->parent->power.power_state.event);
 			dev->parent->power.power_state.event);
 	}
 	}
 
 
-	if (dev->class && dev->class->suspend && !dev->power.power_state.event) {
+	if (dev->class && dev->class->suspend) {
 		suspend_device_dbg(dev, state, "class ");
 		suspend_device_dbg(dev, state, "class ");
 		error = dev->class->suspend(dev, state);
 		error = dev->class->suspend(dev, state);
 		suspend_report_result(dev->class->suspend, error);
 		suspend_report_result(dev->class->suspend, error);
 	}
 	}
 
 
-	if (!error && dev->type && dev->type->suspend
-	    && !dev->power.power_state.event) {
+	if (!error && dev->type && dev->type->suspend) {
 		suspend_device_dbg(dev, state, "type ");
 		suspend_device_dbg(dev, state, "type ");
 		error = dev->type->suspend(dev, state);
 		error = dev->type->suspend(dev, state);
 		suspend_report_result(dev->type->suspend, error);
 		suspend_report_result(dev->type->suspend, error);
 	}
 	}
 
 
-	if (!error && dev->bus && dev->bus->suspend
-	    && !dev->power.power_state.event) {
+	if (!error && dev->bus && dev->bus->suspend) {
 		suspend_device_dbg(dev, state, "");
 		suspend_device_dbg(dev, state, "");
 		error = dev->bus->suspend(dev, state);
 		error = dev->bus->suspend(dev, state);
 		suspend_report_result(dev->bus->suspend, error);
 		suspend_report_result(dev->bus->suspend, error);
@@ -104,8 +102,7 @@ static int suspend_device_late(struct device *dev, pm_message_t state)
 {
 {
 	int error = 0;
 	int error = 0;
 
 
-	if (dev->bus && dev->bus->suspend_late
-	    && !dev->power.power_state.event) {
+	if (dev->bus && dev->bus->suspend_late) {
 		suspend_device_dbg(dev, state, "LATE ");
 		suspend_device_dbg(dev, state, "LATE ");
 		error = dev->bus->suspend_late(dev, state);
 		error = dev->bus->suspend_late(dev, state);
 		suspend_report_result(dev->bus->suspend_late, error);
 		suspend_report_result(dev->bus->suspend_late, error);