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

Commit 86e4e20e authored by Rafael J. Wysocki's avatar Rafael J. Wysocki Committed by Len Brown
Browse files

ACPI: Always check if _PRW is present before trying to evaluate it



Before evaluating _PRW for devices that are reported as inactive or
not present by their _STA control methods we should check if those
methods are actually present (otherwise the evaulation of _PRW will
obviously fail and a scary message will be printed unnecessarily).

Reported-by: default avatarAndreas Mohr <andi@lisas.de>
Reported-by: default avatarMaciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent d0515d9f
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -1388,7 +1388,6 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl,
	struct acpi_bus_ops *ops = context;
	struct acpi_bus_ops *ops = context;
	int type;
	int type;
	unsigned long long sta;
	unsigned long long sta;
	struct acpi_device_wakeup wakeup;
	struct acpi_device *device;
	struct acpi_device *device;
	acpi_status status;
	acpi_status status;
	int result;
	int result;
@@ -1399,7 +1398,13 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl,


	if (!(sta & ACPI_STA_DEVICE_PRESENT) &&
	if (!(sta & ACPI_STA_DEVICE_PRESENT) &&
	    !(sta & ACPI_STA_DEVICE_FUNCTIONING)) {
	    !(sta & ACPI_STA_DEVICE_FUNCTIONING)) {
		acpi_bus_extract_wakeup_device_power_package(handle, &wakeup);
		struct acpi_device_wakeup wakeup;
		acpi_handle temp;

		status = acpi_get_handle(handle, "_PRW", &temp);
		if (ACPI_SUCCESS(status))
			acpi_bus_extract_wakeup_device_power_package(handle,
								     &wakeup);
		return AE_CTRL_DEPTH;
		return AE_CTRL_DEPTH;
	}
	}