]> git.baikalelectronics.ru Git - kernel.git/commit
ACPI / utils: Add acpi_dev_present()
authorLukas Wunner <lukas@wunner.de>
Wed, 25 Nov 2015 20:19:55 +0000 (21:19 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 9 Dec 2015 00:31:41 +0000 (01:31 +0100)
commitabd28f0d986cb077a6f515e9b7151ad29bab5c05
tree43b44ae5508885d7170fc074d394f9e4aad7ca0b
parent4f171a14f52342fd9356ded53b4ba10e8b65de4e
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>
drivers/acpi/internal.h
drivers/acpi/scan.c
drivers/acpi/utils.c
include/acpi/acpi_bus.h