diff options
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index c26468da4295..be9a878557c7 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -199,15 +199,14 @@ int acpi_bus_set_power(acpi_handle handle, int state) | |||
199 | * Get device's current power state if it's unknown | 199 | * Get device's current power state if it's unknown |
200 | * This means device power state isn't initialized or previous setting failed | 200 | * This means device power state isn't initialized or previous setting failed |
201 | */ | 201 | */ |
202 | if (!device->flags.force_power_state) { | 202 | if ((device->power.state == ACPI_STATE_UNKNOWN) || device->flags.force_power_state) |
203 | if (device->power.state == ACPI_STATE_UNKNOWN) | 203 | acpi_bus_get_power(device->handle, &device->power.state); |
204 | acpi_bus_get_power(device->handle, &device->power.state); | 204 | if ((state == device->power.state) && !device->flags.force_power_state) { |
205 | if (state == device->power.state) { | 205 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", |
206 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n", | 206 | state)); |
207 | state)); | 207 | return 0; |
208 | return 0; | ||
209 | } | ||
210 | } | 208 | } |
209 | |||
211 | if (!device->power.states[state].flags.valid) { | 210 | if (!device->power.states[state].flags.valid) { |
212 | printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); | 211 | printk(KERN_WARNING PREFIX "Device does not support D%d\n", state); |
213 | return -ENODEV; | 212 | return -ENODEV; |