diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/acpi/scan.c | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index de73fdf89598..45fbe95ba1f3 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -1673,22 +1673,32 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type, | |||
1673 | return 0; | 1673 | return 0; |
1674 | } | 1674 | } |
1675 | 1675 | ||
1676 | static bool acpi_scan_handler_matching(struct acpi_scan_handler *handler, | ||
1677 | char *idstr, | ||
1678 | const struct acpi_device_id **matchid) | ||
1679 | { | ||
1680 | const struct acpi_device_id *devid; | ||
1681 | |||
1682 | for (devid = handler->ids; devid->id[0]; devid++) | ||
1683 | if (!strcmp((char *)devid->id, idstr)) { | ||
1684 | if (matchid) | ||
1685 | *matchid = devid; | ||
1686 | |||
1687 | return true; | ||
1688 | } | ||
1689 | |||
1690 | return false; | ||
1691 | } | ||
1692 | |||
1676 | static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr, | 1693 | static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr, |
1677 | const struct acpi_device_id **matchid) | 1694 | const struct acpi_device_id **matchid) |
1678 | { | 1695 | { |
1679 | struct acpi_scan_handler *handler; | 1696 | struct acpi_scan_handler *handler; |
1680 | 1697 | ||
1681 | list_for_each_entry(handler, &acpi_scan_handlers_list, list_node) { | 1698 | list_for_each_entry(handler, &acpi_scan_handlers_list, list_node) |
1682 | const struct acpi_device_id *devid; | 1699 | if (acpi_scan_handler_matching(handler, idstr, matchid)) |
1683 | 1700 | return handler; | |
1684 | for (devid = handler->ids; devid->id[0]; devid++) | ||
1685 | if (!strcmp((char *)devid->id, idstr)) { | ||
1686 | if (matchid) | ||
1687 | *matchid = devid; | ||
1688 | 1701 | ||
1689 | return handler; | ||
1690 | } | ||
1691 | } | ||
1692 | return NULL; | 1702 | return NULL; |
1693 | } | 1703 | } |
1694 | 1704 | ||