aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/device_pm.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-22 12:56:35 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-22 12:56:35 +0100
commite5656271b0221a53e9f74856385112fdcec0dd60 (patch)
treebd486b5c6c93154a68cf13c38aa7f2d70a71392c /drivers/acpi/device_pm.c
parent898fee4f6ed52b5b5dd159b221d2ad7ce40ae2dd (diff)
ACPI / PM: Fix device power state value after transitions to D3cold
When a transition to the D3cold power state is requested, acpi_device_set_power() first carries out a transition to D3hot and then turns off the device's power resources. However, it fails to update the device's power.state field appropriately and D3hot is stored in it as a result. Fix this, but make sure that the device's power state will be D3hot if its power resources cannot be turned off in the final step. 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.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index 61ae99b09f1..4cbc9505b36 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -264,8 +264,11 @@ int acpi_device_set_power(struct acpi_device *device, int state)
if (result)
goto end;
- if (cut_power)
- result = acpi_power_transition(device, ACPI_STATE_D3_COLD);
+ if (cut_power) {
+ device->power.state = state;
+ state = ACPI_STATE_D3_COLD;
+ result = acpi_power_transition(device, state);
+ }
end:
if (result) {