提交 4b59cc1f 编写于 作者: R Rafael J. Wysocki

ACPI / scan: Introduce acpi_scan_handler_matching()

Introduce new helper routine acpi_scan_handler_matching() for
checking if the given ACPI scan handler matches a given device ID
and rework acpi_scan_match_handler() to use the new routine (that
routine will also be useful for other purposes in the future).
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: NYasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Acked-by: NToshi Kani <toshi.kani@hp.com>
Tested-by: NToshi Kani <toshi.kani@hp.com>
上级 68a67f6c
...@@ -1673,12 +1673,10 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type, ...@@ -1673,12 +1673,10 @@ static int acpi_bus_type_and_status(acpi_handle handle, int *type,
return 0; return 0;
} }
static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr, static bool acpi_scan_handler_matching(struct acpi_scan_handler *handler,
char *idstr,
const struct acpi_device_id **matchid) const struct acpi_device_id **matchid)
{ {
struct acpi_scan_handler *handler;
list_for_each_entry(handler, &acpi_scan_handlers_list, list_node) {
const struct acpi_device_id *devid; const struct acpi_device_id *devid;
for (devid = handler->ids; devid->id[0]; devid++) for (devid = handler->ids; devid->id[0]; devid++)
...@@ -1686,9 +1684,21 @@ static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr, ...@@ -1686,9 +1684,21 @@ static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr,
if (matchid) if (matchid)
*matchid = devid; *matchid = devid;
return handler; return true;
}
} }
return false;
}
static struct acpi_scan_handler *acpi_scan_match_handler(char *idstr,
const struct acpi_device_id **matchid)
{
struct acpi_scan_handler *handler;
list_for_each_entry(handler, &acpi_scan_handlers_list, list_node)
if (acpi_scan_handler_matching(handler, idstr, matchid))
return handler;
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册