Commit 02f8a858 authored by Andrew Patterson's avatar Andrew Patterson Committed by Len Brown

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: default avatarAndrew Patterson <andrew.patterson@hp.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent cbd9c883
...@@ -443,6 +443,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, ...@@ -443,6 +443,7 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
struct acpica_device_id hid; struct acpica_device_id hid;
struct acpi_compatible_id_list *cid; struct acpi_compatible_id_list *cid;
acpi_native_uint i; acpi_native_uint i;
int found;
status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE); status = acpi_ut_acquire_mutex(ACPI_MTX_NAMESPACE);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
...@@ -496,16 +497,19 @@ acpi_ns_get_device_callback(acpi_handle obj_handle, ...@@ -496,16 +497,19 @@ acpi_ns_get_device_callback(acpi_handle obj_handle,
/* Walk the CID list */ /* Walk the CID list */
found = 0;
for (i = 0; i < cid->count; i++) { for (i = 0; i < cid->count; i++) {
if (ACPI_STRNCMP(cid->id[i].value, info->hid, if (ACPI_STRNCMP(cid->id[i].value, info->hid,
sizeof(struct sizeof(struct
acpi_compatible_id)) != acpi_compatible_id)) ==
0) { 0) {
ACPI_FREE(cid); found = 1;
return (AE_OK); break;
} }
} }
ACPI_FREE(cid); ACPI_FREE(cid);
if (!found)
return (AE_OK);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment