aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/device_pm.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-03 08:57:32 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-02-03 08:57:32 -0500
commit511d5c4212948fe55035b8fed61ac0e125af5a05 (patch)
tree3b8b6a2d929aa8515f4de4e736f10626e747cdf0 /drivers/acpi/device_pm.c
parentb3785492268f9f3cdaa9722facb84b266dcf8bf6 (diff)
ACPI / PM: Handle missing _PSC in acpi_bus_update_power()
If _PS0 is defined for an ACPI device node, but _PSC isn't and the device node doesn't use power resources for power management, acpi_bus_update_power() will fail to update the power state of it, because acpi_device_get_power() returns ACPI_STATE_UNKNOWN in that case. To handle that situation make acpi_bus_update_power() follow acpi_bus_init_power() and try to force the given device node into power state D0. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/device_pm.c')
-rw-r--r--drivers/acpi/device_pm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 164d609d7c9e..dd314ef9bff1 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -355,6 +355,9 @@ int acpi_bus_update_power(acpi_handle handle, int *state_p)
355 if (result) 355 if (result)
356 return result; 356 return result;
357 357
358 if (state == ACPI_STATE_UNKNOWN)
359 state = ACPI_STATE_D0;
360
358 result = acpi_device_set_power(device, state); 361 result = acpi_device_set_power(device, state);
359 if (!result && state_p) 362 if (!result && state_p)
360 *state_p = state; 363 *state_p = state;