From: Rafael J. Wysocki Date: Wed, 24 Nov 2010 23:03:32 +0000 (+0100) Subject: ACPI / PM: Do not refcount power resources that can't be turned on X-Git-Tag: v2.6.37-rc6~17^2~1^3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=12b3b5afed67e08aa641d30e57df20dab2e33432;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git ACPI / PM: Do not refcount power resources that can't be turned on If turning on a power resource fails, do not reference count it, since it cannot be in use in that case. Signed-off-by: Rafael J. Wysocki Signed-off-by: Len Brown --- diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 792a830..4c9c2fb 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle) resource->name)); } else { result = __acpi_power_on(resource); + if (result) + resource->ref_count--; } mutex_unlock(&resource->resource_lock); - return 0; + return result; } static int acpi_power_off_device(acpi_handle handle)