@@ -719,6 +719,28 @@ int acpi_device_add(struct acpi_device *device,
/* --------------------------------------------------------------------------
Device Enumeration
-------------------------------------------------------------------------- */
+static bool acpi_info_matches_hids(struct acpi_device_info *info,
+ const char * const hids[])
+{
+ int i;
+
+ if (!(info->valid & ACPI_VALID_HID))
+ return false;
+
+ for (i = 0; hids[i]; i++) {
+ if (!strcmp(info->hardware_id.string, hids[i]))
+ return true;
+ }
+
+ return false;
+}
+
+/* List of HIDs for which we ignore matching ACPI devices, when checking _DEP lists. */
+static const char * const acpi_ignore_dep_hids[] = {
+ "INT3396", /* Windows System Power Management Controller */
+ NULL
+};
+
static struct acpi_device *acpi_bus_get_parent(acpi_handle handle)
{
struct acpi_device *device = NULL;
@@ -1833,13 +1855,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
continue;
}
- /*
- * Skip the dependency of Windows System Power
- * Management Controller
- */
- skip = info->valid & ACPI_VALID_HID &&
- !strcmp(info->hardware_id.string, "INT3396");
-
+ skip = acpi_info_matches_hids(info, acpi_ignore_dep_hids);
kfree(info);
if (skip)
acpi_device_dep_initialize() skips _DEPS with a HID of "INT3396" and checks this using an acpi_device_info struct. The upcoming changes splitting the scanning of the root into 2 steps, deferring the addition of some devices which need access to OpRegions of other devices during scanning to the second step, need to extend the HIDs to skip during _DEP checking to a list of HIDs; and need to check an acpi_device_info struct against a list of HIDs in more places. Add an acpi_info_matches_hids() helper which checks a list of HIDs for this and switch acpi_device_dep_initialize() over to this helper. Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/acpi/scan.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-)