@@ -312,6 +312,30 @@ int acpi_match_device_ids(struct acpi_device *device,
}
EXPORT_SYMBOL(acpi_match_device_ids);
+int acpi_match_object_info_ids(struct acpi_device_info *info,
+ const struct acpi_device_id *ids)
+{
+ char *hardware_id;
+ int i, j;
+
+ for (i = 0; ids[i].id[0]; i++) {
+ hardware_id = info->hardware_id.string;
+ if (hardware_id &&
+ !strcmp((char *)ids[i].id, hardware_id))
+ return 0;
+
+ for (j = 0; j < info->compatible_id_list.count; j++) {
+ hardware_id = info->compatible_id_list.ids[j].string;
+ if (hardware_id &&
+ !strcmp((char *)ids[i].id, hardware_id))
+ return 0;
+ }
+ }
+
+ return 1;
+}
+EXPORT_SYMBOL(acpi_match_object_info_ids);
+
static void acpi_free_ids(struct acpi_device *device)
{
struct acpi_hardware_id *id, *tmp;
@@ -379,6 +379,8 @@ int acpi_bus_start(struct acpi_device *device);
acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd);
int acpi_match_device_ids(struct acpi_device *device,
const struct acpi_device_id *ids);
+int acpi_match_object_info_ids(struct acpi_device_info *info,
+ const struct acpi_device_id *ids);
int acpi_create_dir(struct acpi_device *);
void acpi_remove_dir(struct acpi_device *);
This introduce a new api to determine if a HID matches a list of IDs. Different from acpi_match_device_ids(), the new api gets HID from acpi_device_info struct. Signed-off-by: Tang Chen <tangchen@cn.fujitsu.com> --- drivers/acpi/scan.c | 24 ++++++++++++++++++++++++ include/acpi/acpi_bus.h | 2 ++ 2 files changed, 26 insertions(+), 0 deletions(-)