Revert "ACPI: scan: Do not add device IDs from _CID if _HID is not valid"
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 16 Mar 2022 10:23:05 +0000 (11:23 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 16 Mar 2022 10:23:05 +0000 (11:23 +0100)
Revert commit e38f9ff63e6d ("ACPI: scan: Do not add device IDs from _CID
if _HID is not valid"), because it has introduced regressions on
multiple systems, even though it only has effect on clearly invalid
firmware.

Reported-by: Pierre-Louis Bossart <notifications@github.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/scan.c

index 1331756..8b2e5ef 100644 (file)
@@ -1377,11 +1377,11 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp,
                if (info->valid & ACPI_VALID_HID) {
                        acpi_add_id(pnp, info->hardware_id.string);
                        pnp->type.platform_id = 1;
-                       if (info->valid & ACPI_VALID_CID) {
-                               cid_list = &info->compatible_id_list;
-                               for (i = 0; i < cid_list->count; i++)
-                                       acpi_add_id(pnp, cid_list->ids[i].string);
-                       }
+               }
+               if (info->valid & ACPI_VALID_CID) {
+                       cid_list = &info->compatible_id_list;
+                       for (i = 0; i < cid_list->count; i++)
+                               acpi_add_id(pnp, cid_list->ids[i].string);
                }
                if (info->valid & ACPI_VALID_ADR) {
                        pnp->bus_address = info->address;