diff options
author | Lukas Wunner <lukas@wunner.de> | 2015-11-25 21:19:55 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-12-09 01:31:41 +0100 |
commit | 2d12b6b381ba059d5f92798f5ea739672a2f5fcf (patch) | |
tree | 43b44ae5508885d7170fc074d394f9e4aad7ca0b /include/acpi/acpi_bus.h | |
parent | ACPI / scan: Fix acpi_bus_id_list bookkeeping (diff) | |
download | linux-2d12b6b381ba059d5f92798f5ea739672a2f5fcf.tar.xz linux-2d12b6b381ba059d5f92798f5ea739672a2f5fcf.zip |
ACPI / utils: Add acpi_dev_present()
There's an idiom in use by 7 Linux drivers to detect the presence of a
particular ACPI HID by walking the namespace with acpi_get_devices().
The callback passed to acpi_get_devices() is mostly identical across
the drivers, leading to lots of duplicate code.
Add acpi_dev_present(), the ACPI equivalent to pci_dev_present(),
allowing us to deduplicate all that boilerplate in the drivers.
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi/acpi_bus.h')
-rw-r--r-- | include/acpi/acpi_bus.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index ad0a5ff3d4cd..0fe7babf9c24 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -87,6 +87,8 @@ acpi_evaluate_dsm_typed(acpi_handle handle, const u8 *uuid, int rev, int func, .package.elements = (eles) \ } +bool acpi_dev_present(const char *hid); + #ifdef CONFIG_ACPI #include <linux/proc_fs.h> |