diff options
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r-- | drivers/acpi/bus.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 5c00e5e18da8..676c9788e1c8 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -819,6 +819,24 @@ const struct acpi_device_id *acpi_match_device(const struct acpi_device_id *ids, | |||
819 | } | 819 | } |
820 | EXPORT_SYMBOL_GPL(acpi_match_device); | 820 | EXPORT_SYMBOL_GPL(acpi_match_device); |
821 | 821 | ||
822 | void *acpi_get_match_data(const struct device *dev) | ||
823 | { | ||
824 | const struct acpi_device_id *match; | ||
825 | |||
826 | if (!dev->driver) | ||
827 | return NULL; | ||
828 | |||
829 | if (!dev->driver->acpi_match_table) | ||
830 | return NULL; | ||
831 | |||
832 | match = acpi_match_device(dev->driver->acpi_match_table, dev); | ||
833 | if (!match) | ||
834 | return NULL; | ||
835 | |||
836 | return (void *)match->driver_data; | ||
837 | } | ||
838 | EXPORT_SYMBOL_GPL(acpi_get_match_data); | ||
839 | |||
822 | int acpi_match_device_ids(struct acpi_device *device, | 840 | int acpi_match_device_ids(struct acpi_device *device, |
823 | const struct acpi_device_id *ids) | 841 | const struct acpi_device_id *ids) |
824 | { | 842 | { |