ACPI: Check for any matching CID when walking namespace.

The callback function acpi_ns_get_device_callback called from
acpi_get_devices() will check CID's if the HID does not match.  This code
has a bug where it requires that all CIDs match the HID. Changed the code
so that any CID match will do.

Signed-off-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Andrew Patterson 2008-01-22 17:18:22 -07:00 committed by Len Brown
parent cbd9c88369
commit 02f8a85865

View file

@ -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)) {
@ -496,18 +497,21 @@ 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) {
found = 1;
break;
}
}
ACPI_FREE(cid);
if (!found)
return (AE_OK);
}
}
ACPI_FREE(cid);
}
}
status = info->user_function(obj_handle, nesting_level, info->context,
return_value);