diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-11-24 18:05:17 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2011-01-12 04:48:43 -0500 |
commit | 32a00d274e877eab3ea7ab196b75c9be5170d25e (patch) | |
tree | 0b7a515e8b2328e8cf8b22794cdf81ab19838b5d /drivers/acpi/bus.c | |
parent | 3c0eee3fe6a3a1c745379547c7e7c904aa64f6d5 (diff) |
ACPI / PM: Prevent acpi_power_get_inferred_state() from making changes
acpi_power_get_inferred_state() should not update
device->power.state behind the back of its caller, so make it return
the state via a pointer instead.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index d68bd61072bb..a9fe8e6bc40e 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -222,7 +222,8 @@ int acpi_bus_get_power(acpi_handle handle, int *state) | |||
222 | * indirectly (via power resources). | 222 | * indirectly (via power resources). |
223 | */ | 223 | */ |
224 | if (device->power.flags.power_resources) { | 224 | if (device->power.flags.power_resources) { |
225 | result = acpi_power_get_inferred_state(device); | 225 | result = acpi_power_get_inferred_state(device, |
226 | &device->power.state); | ||
226 | if (result) | 227 | if (result) |
227 | return result; | 228 | return result; |
228 | } else if (device->power.flags.explicit_get) { | 229 | } else if (device->power.flags.explicit_get) { |