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>
This commit is contained in:
Rafael J. Wysocki 2010-11-25 00:03:32 +01:00 committed by Len Brown
parent 212967c69a
commit 12b3b5afed
1 changed files with 3 additions and 1 deletions

View File

@ -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)