From b1b57fbe9bb10d94682a975456de7a727d1dbc84 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 27 Oct 2008 16:04:53 +0800 Subject: ACPI: fix de-reference bug in power resource driver change state to *state in the function of acpi_power_get_state() Signed-off-by: yakui.zhao@intel.com Signed-off-by: Len Brown --- drivers/acpi/power.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index a1718e56103..30d4a5282a2 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -153,7 +153,8 @@ static int acpi_power_get_state(acpi_handle handle, int *state) ACPI_POWER_RESOURCE_STATE_OFF; ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Resource [%s] is %s\n", - acpi_ut_get_node_name(handle), state ? "on" : "off")); + acpi_ut_get_node_name(handle), + *state ? "on" : "off")); return 0; } -- cgit v1.2.3 From 676962dac6e267ce7c13f73962208f9124a084bb Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Mon, 27 Oct 2008 16:05:39 +0800 Subject: ACPI: fan: Delete the strict check in power transition On some laptops the Fan device is turned on/off by controlling the corresponding power resource. For example: If the power resource defined in _PR0 object is turned off, it indicates that the FAN device is in off state(the ACPI state is in D3 state). Maybe the device is already in D3 state and expected to be transited to D3 state. As there is no _PR3 object, the power transition can't be finished and it will be switched to the Unknown state. Maybe it is more reasonable that the strick check in power transistion is deleted. http://bugzilla.kernel.org/show_bug.cgi?id=9485 Signed-off-by: yakui.zhao@intel.com Signed-off-by: Len Brown --- drivers/acpi/power.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 30d4a5282a2..89111cd28ed 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -517,11 +517,6 @@ int acpi_power_transition(struct acpi_device *device, int state) cl = &device->power.states[device->power.state].resources; tl = &device->power.states[state].resources; - if (!cl->count && !tl->count) { - result = -ENODEV; - goto end; - } - /* TBD: Resources must be ordered. */ /* -- cgit v1.2.3