summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/scan.c
diff options
context:
space:
mode:
authorLukas Wunner <lukas@wunner.de>2015-11-25 21:19:55 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2015-12-09 01:31:41 +0100
commit2d12b6b381ba059d5f92798f5ea739672a2f5fcf (patch)
tree43b44ae5508885d7170fc074d394f9e4aad7ca0b /drivers/acpi/scan.c
parentca9dc8d42b30e2d766b471fe5ecf0c71fd309c8f (diff)
downloadop-kernel-dev-2d12b6b381ba059d5f92798f5ea739672a2f5fcf.zip
op-kernel-dev-2d12b6b381ba059d5f92798f5ea739672a2f5fcf.tar.gz
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 'drivers/acpi/scan.c')
-rw-r--r--drivers/acpi/scan.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index be1fc12..407a376 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -39,7 +39,7 @@ static const char *dummy_hid = "device";
static LIST_HEAD(acpi_dep_list);
static DEFINE_MUTEX(acpi_dep_list_lock);
-static LIST_HEAD(acpi_bus_id_list);
+LIST_HEAD(acpi_bus_id_list);
static DEFINE_MUTEX(acpi_scan_lock);
static LIST_HEAD(acpi_scan_handlers_list);
DEFINE_MUTEX(acpi_device_lock);
@@ -52,12 +52,6 @@ struct acpi_dep_data {
acpi_handle slave;
};
-struct acpi_device_bus_id{
- char bus_id[15];
- unsigned int instance_no;
- struct list_head node;
-};
-
void acpi_scan_lock_acquire(void)
{
mutex_lock(&acpi_scan_lock);
OpenPOWER on IntegriCloud