diff options
Diffstat (limited to 'drivers/acpi/device_pm.c')
-rw-r--r-- | drivers/acpi/device_pm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 28cffaaf9d82..f616b16c1f0b 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c | |||
@@ -232,13 +232,15 @@ int acpi_device_set_power(struct acpi_device *device, int state) | |||
232 | if (device->power.flags.power_resources) | 232 | if (device->power.flags.power_resources) |
233 | result = acpi_power_transition(device, target_state); | 233 | result = acpi_power_transition(device, target_state); |
234 | } else { | 234 | } else { |
235 | int cur_state = device->power.state; | ||
236 | |||
235 | if (device->power.flags.power_resources) { | 237 | if (device->power.flags.power_resources) { |
236 | result = acpi_power_transition(device, ACPI_STATE_D0); | 238 | result = acpi_power_transition(device, ACPI_STATE_D0); |
237 | if (result) | 239 | if (result) |
238 | goto end; | 240 | goto end; |
239 | } | 241 | } |
240 | 242 | ||
241 | if (device->power.state == ACPI_STATE_D0) { | 243 | if (cur_state == ACPI_STATE_D0) { |
242 | int psc; | 244 | int psc; |
243 | 245 | ||
244 | /* Nothing to do here if _PSC is not present. */ | 246 | /* Nothing to do here if _PSC is not present. */ |