From 32a00d274e877eab3ea7ab196b75c9be5170d25e Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Thu, 25 Nov 2010 00:05:17 +0100 Subject: 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 Signed-off-by: Len Brown --- drivers/acpi/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/acpi/bus.c') 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) * indirectly (via power resources). */ if (device->power.flags.power_resources) { - result = acpi_power_get_inferred_state(device); + result = acpi_power_get_inferred_state(device, + &device->power.state); if (result) return result; } else if (device->power.flags.explicit_get) { -- cgit v1.2.3