[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201101062340.00868.rjw@sisk.pl>
Date: Thu, 6 Jan 2011 23:40:00 +0100
From: "Rafael J. Wysocki" <rjw@...k.pl>
To: Len Brown <lenb@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Matthew Garrett <mjg59@...f.ucam.org>,
ACPI Devel Maling List <linux-acpi@...r.kernel.org>,
"Linux-pm mailing list" <linux-pm@...ts.linux-foundation.org>,
Andreas Mohr <andi@...as.de>,
Maciej Rutecki <maciej.rutecki@...il.com>
Subject: [PATCH 9/11] ACPI: Always check if _PRW is present before trying to evaluate it
From: Rafael J. Wysocki <rjw@...k.pl>
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: Andreas Mohr <andi@...as.de>
Reported-by: Maciej Rutecki <maciej.rutecki@...il.com>
Signed-off-by: Rafael J. Wysocki <rjw@...k.pl>
---
drivers/acpi/scan.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/acpi/scan.c
===================================================================
--- linux-2.6.orig/drivers/acpi/scan.c
+++ linux-2.6/drivers/acpi/scan.c
@@ -1388,7 +1388,6 @@ static acpi_status acpi_bus_check_add(ac
struct acpi_bus_ops *ops = context;
int type;
unsigned long long sta;
- struct acpi_device_wakeup wakeup;
struct acpi_device *device;
acpi_status status;
int result;
@@ -1399,7 +1398,13 @@ static acpi_status acpi_bus_check_add(ac
if (!(sta & ACPI_STA_DEVICE_PRESENT) &&
!(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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists