Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 12b3b5af authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown
Browse files

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: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 212967c6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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)