diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2010-11-25 00:03:32 +0100 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-12-01 16:53:39 -0500 |
commit | 12b3b5afed67e08aa641d30e57df20dab2e33432 (patch) | |
tree | 426ff6eb6f25ff8a3641ce74f597d44536034c64 /drivers/acpi/power.c | |
parent | 212967c69afd348342548272aedbe4d46a9325d6 (diff) |
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 <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/power.c')
-rw-r--r-- | drivers/acpi/power.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 792a8309d074..4c9c2fb5d98f 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) |