From f917a6faaf1ed8bfb13e1f29a9cf00c07a098c63 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Wed, 6 Feb 2013 13:05:22 +0100 Subject: [PATCH] --- yaml --- r: 350973 b: refs/heads/master c: 87b85b3c8a4ac286d41a1c6419014b7562e4663b h: refs/heads/master i: 350971: b486b0afcd3b98abdabba234e9e93cdf9bb6bffb v: v3 --- [refs] | 2 +- trunk/drivers/acpi/scan.c | 40 +++++++++++++++++++++++++++------------ 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 3f84321f7073..98fed5bad6aa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 73ce873a898ff385cd18e9068d38a35ff48e7585 +refs/heads/master: 87b85b3c8a4ac286d41a1c6419014b7562e4663b diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c index 360f1338749b..688b7f7c23dd 100644 --- a/trunk/drivers/acpi/scan.c +++ b/trunk/drivers/acpi/scan.c @@ -1553,26 +1553,42 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, return AE_OK; } -static int acpi_scan_attach_handler(struct acpi_device *device) +static int acpi_scan_do_attach_handler(struct acpi_device *device, char *id) { struct acpi_scan_handler *handler; - int ret = 0; list_for_each_entry(handler, &acpi_scan_handlers_list, list_node) { - const struct acpi_device_id *id; + const struct acpi_device_id *devid; - id = __acpi_match_device(device, handler->ids); - if (!id) - continue; + for (devid = handler->ids; devid->id[0]; devid++) { + int ret; - ret = handler->attach(device, id); - if (ret > 0) { - device->handler = handler; - break; - } else if (ret < 0) { - break; + if (strcmp((char *)devid->id, id)) + continue; + + ret = handler->attach(device, devid); + if (ret > 0) { + device->handler = handler; + return ret; + } else if (ret < 0) { + return ret; + } } } + return 0; +} + +static int acpi_scan_attach_handler(struct acpi_device *device) +{ + struct acpi_hardware_id *hwid; + int ret = 0; + + list_for_each_entry(hwid, &device->pnp.ids, list) { + ret = acpi_scan_do_attach_handler(device, hwid->id); + if (ret) + break; + + } return ret; }