diff options
author | Jiri Kosina <jkosina@suse.cz> | 2010-04-22 20:08:44 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-04-22 20:08:44 -0400 |
commit | 6c9468e9eb1252eaefd94ce7f06e1be9b0b641b1 (patch) | |
tree | 797676a336b050bfa1ef879377c07e541b9075d6 /drivers/acpi/bus.c | |
parent | 4cb3ca7cd7e2cae8d1daf5345ec99a1e8502cf3f (diff) | |
parent | c81eddb0e3728661d1585fbc564449c94165cc36 (diff) |
Merge branch 'master' into for-next
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index a52126e46307..37132dc2da03 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/device.h> | 32 | #include <linux/device.h> |
33 | #include <linux/proc_fs.h> | 33 | #include <linux/proc_fs.h> |
34 | #include <linux/acpi.h> | 34 | #include <linux/acpi.h> |
35 | #include <linux/slab.h> | ||
35 | #ifdef CONFIG_X86 | 36 | #ifdef CONFIG_X86 |
36 | #include <asm/mpspec.h> | 37 | #include <asm/mpspec.h> |
37 | #endif | 38 | #endif |
@@ -190,16 +191,16 @@ int acpi_bus_get_power(acpi_handle handle, int *state) | |||
190 | * Get the device's power state either directly (via _PSC) or | 191 | * Get the device's power state either directly (via _PSC) or |
191 | * indirectly (via power resources). | 192 | * indirectly (via power resources). |
192 | */ | 193 | */ |
193 | if (device->power.flags.explicit_get) { | 194 | if (device->power.flags.power_resources) { |
195 | result = acpi_power_get_inferred_state(device); | ||
196 | if (result) | ||
197 | return result; | ||
198 | } else if (device->power.flags.explicit_get) { | ||
194 | status = acpi_evaluate_integer(device->handle, "_PSC", | 199 | status = acpi_evaluate_integer(device->handle, "_PSC", |
195 | NULL, &psc); | 200 | NULL, &psc); |
196 | if (ACPI_FAILURE(status)) | 201 | if (ACPI_FAILURE(status)) |
197 | return -ENODEV; | 202 | return -ENODEV; |
198 | device->power.state = (int)psc; | 203 | device->power.state = (int)psc; |
199 | } else if (device->power.flags.power_resources) { | ||
200 | result = acpi_power_get_inferred_state(device); | ||
201 | if (result) | ||
202 | return result; | ||
203 | } | 204 | } |
204 | 205 | ||
205 | *state = device->power.state; | 206 | *state = device->power.state; |