aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/power.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2010-11-24 18:03:32 -0500
committerLen Brown <len.brown@intel.com>2010-12-01 16:53:39 -0500
commit12b3b5afed67e08aa641d30e57df20dab2e33432 (patch)
tree426ff6eb6f25ff8a3641ce74f597d44536034c64 /drivers/acpi/power.c
parent212967c69afd348342548272aedbe4d46a9325d6 (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.c4
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)
213 resource->name)); 213 resource->name));
214 } else { 214 } else {
215 result = __acpi_power_on(resource); 215 result = __acpi_power_on(resource);
216 if (result)
217 resource->ref_count--;
216 } 218 }
217 219
218 mutex_unlock(&resource->resource_lock); 220 mutex_unlock(&resource->resource_lock);
219 221
220 return 0; 222 return result;
221} 223}
222 224
223static int acpi_power_off_device(acpi_handle handle) 225static int acpi_power_off_device(acpi_handle handle)