Merge branch 'connlimit' of git://dev.medozas.de/linux
[pandora-kernel.git] / drivers / acpi / scan.c
index 64d4da0..b99e624 100644 (file)
@@ -815,16 +815,22 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
                                !!(event_status & ACPI_EVENT_FLAG_HANDLE);
 }
 
-static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
+static void acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
 {
+       acpi_handle temp;
        acpi_status status = 0;
        int psw_error;
 
+       /* Presence of _PRW indicates wake capable */
+       status = acpi_get_handle(device->handle, "_PRW", &temp);
+       if (ACPI_FAILURE(status))
+               return;
+
        status = acpi_bus_extract_wakeup_device_power_package(device->handle,
                                                              &device->wakeup);
        if (ACPI_FAILURE(status)) {
                ACPI_EXCEPTION((AE_INFO, status, "Extracting _PRW package"));
-               goto end;
+               return;
        }
 
        device->wakeup.flags.valid = 1;
@@ -840,11 +846,6 @@ static int acpi_bus_get_wakeup_device_flags(struct acpi_device *device)
        if (psw_error)
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                                "error in _DSW or _PSW evaluation\n"));
-
-end:
-       if (ACPI_FAILURE(status))
-               device->flags.wake_capable = 0;
-       return 0;
 }
 
 static void acpi_bus_add_power_resource(acpi_handle handle);
@@ -950,11 +951,6 @@ static int acpi_bus_get_flags(struct acpi_device *device)
        if (ACPI_SUCCESS(status))
                device->flags.power_manageable = 1;
 
-       /* Presence of _PRW indicates wake capable */
-       status = acpi_get_handle(device->handle, "_PRW", &temp);
-       if (ACPI_SUCCESS(status))
-               device->flags.wake_capable = 1;
-
        /* TBD: Performance management */
 
        return 0;
@@ -1281,11 +1277,7 @@ static int acpi_add_single_object(struct acpi_device **child,
         * Wakeup device management
         *-----------------------
         */
-       if (device->flags.wake_capable) {
-               result = acpi_bus_get_wakeup_device_flags(device);
-               if (result)
-                       goto end;
-       }
+       acpi_bus_get_wakeup_device_flags(device);
 
        /*
         * Performance Management
@@ -1388,7 +1380,6 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl,
        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 +1390,13 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl,
 
        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;
        }