]> err.no Git - linux-2.6/blobdiff - drivers/acpi/namespace/nsxfeval.c
Merge branch 'for-2.6.26' of master.kernel.org:/pub/scm/linux/kernel/git/jwboyer...
[linux-2.6] / drivers / acpi / namespace / nsxfeval.c
index f39fbc6b9237687a3ffd0c1b387499bb6ad0714c..a8d549187c84262d5ae7ca9bd34ceee6d4a358dd 100644 (file)
@@ -6,7 +6,7 @@
  ******************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2007, R. Byron Moore
+ * Copyright (C) 2000 - 2008, Intel Corp.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -443,6 +443,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
        struct acpica_device_id hid;
        struct acpi_compatible_id_list *cid;
        acpi_native_uint i;
+       int found;
 
        status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
        if (ACPI_FAILURE(status)) {
@@ -466,10 +467,13 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
                return (AE_CTRL_DEPTH);
        }
 
-       if (!(flags & ACPI_STA_DEVICE_PRESENT)) {
-
-               /* Don't examine children of the device if not present */
-
+       if (!(flags & ACPI_STA_DEVICE_PRESENT) &&
+           !(flags & ACPI_STA_DEVICE_FUNCTIONING)) {
+               /*
+                * Don't examine the children of the device only when the
+                * device is neither present nor functional. See ACPI spec,
+                * description of _STA for more information.
+                */
                return (AE_CTRL_DEPTH);
        }
 
@@ -496,16 +500,19 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
 
                        /* Walk the CID list */
 
+                       found = 0;
                        for (i = 0; i < cid->count; i++) {
                                if (ACPI_STRNCMP(cid->id[i].value, info->hid,
                                                 sizeof(struct
-                                                       acpi_compatible_id)) !=
+                                                       acpi_compatible_id)) ==
                                    0) {
-                                       ACPI_FREE(cid);
-                                       return (AE_OK);
+                                       found = 1;
+                                       break;
                                }
                        }
                        ACPI_FREE(cid);
+                       if (!found)
+                               return (AE_OK);
                }
        }
 
@@ -535,7 +542,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
  *              value is returned to the caller.
  *
  *              This is a wrapper for walk_namespace, but the callback performs
- *              additional filtering. Please see acpi_get_device_callback.
+ *              additional filtering. Please see acpi_ns_get_device_callback.
  *
  ******************************************************************************/