aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 4edff1738579..d77c2307883c 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -212,6 +212,12 @@ acpi_bus_set_power (
212 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device is not power manageable\n")); 212 ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Device is not power manageable\n"));
213 return_VALUE(-ENODEV); 213 return_VALUE(-ENODEV);
214 } 214 }
215 /*
216 * Get device's current power state if it's unknown
217 * This means device power state isn't initialized or previous setting failed
218 */
219 if (device->power.state == ACPI_STATE_UNKNOWN)
220 acpi_bus_get_power(device->handle, &device->power.state);
215 if (state == device->power.state) { 221 if (state == device->power.state) {
216 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state)); 222 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", state));
217 return_VALUE(0); 223 return_VALUE(0);
@@ -231,7 +237,7 @@ acpi_bus_set_power (
231 * On transitions to a high-powered state we first apply power (via 237 * On transitions to a high-powered state we first apply power (via
232 * power resources) then evalute _PSx. Conversly for transitions to 238 * power resources) then evalute _PSx. Conversly for transitions to
233 * a lower-powered state. 239 * a lower-powered state.
234 */ 240 */
235 if (state < device->power.state) { 241 if (state < device->power.state) {
236 if (device->power.flags.power_resources) { 242 if (device->power.flags.power_resources) {
237 result = acpi_power_transition(device, state); 243 result = acpi_power_transition(device, state);