Merge branches 'battery-2.6.34', 'bugzilla-10805', 'bugzilla-14668', 'bugzilla-531916...
[safe/jmp/linux-2.6] / drivers / acpi / bus.c
index a52126e..b70cd37 100644 (file)
@@ -190,16 +190,16 @@ int acpi_bus_get_power(acpi_handle handle, int *state)
                 * Get the device's power state either directly (via _PSC) or
                 * indirectly (via power resources).
                 */
-               if (device->power.flags.explicit_get) {
+               if (device->power.flags.power_resources) {
+                       result = acpi_power_get_inferred_state(device);
+                       if (result)
+                               return result;
+               } else if (device->power.flags.explicit_get) {
                        status = acpi_evaluate_integer(device->handle, "_PSC",
                                                       NULL, &psc);
                        if (ACPI_FAILURE(status))
                                return -ENODEV;
                        device->power.state = (int)psc;
-               } else if (device->power.flags.power_resources) {
-                       result = acpi_power_get_inferred_state(device);
-                       if (result)
-                               return result;
                }
 
                *state = device->power.state;