summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-02-22 20:51:42 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-03-02 20:55:47 +0100
commit3c36fe9302d153283a0cea9e4e25a9e2143ac232 (patch)
tree4136b715eb1f3acd078fcc5dd3e7a7077e79f3cd /drivers/acpi
parent7e57714cd0ad2d5bb90e50b5096a0e671dec1ef3 (diff)
ACPI: bus: Introduce acpi_bus_for_each_dev()
In order to avoid exposing acpi_bus_type to modules, introduce an acpi_bus_for_each_dev() helper for iterating over all ACPI device objects and make typec_link_ports() use it instead of the raw bus_for_each_dev() along with acpi_bus_type. Having done that, drop the acpi_bus_type export. No intentional functional impact. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/bus.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 07f604832fd6..647791d34c19 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1043,7 +1043,12 @@ struct bus_type acpi_bus_type = {
.remove = acpi_device_remove,
.uevent = acpi_device_uevent,
};
-EXPORT_SYMBOL_GPL(acpi_bus_type);
+
+int acpi_bus_for_each_dev(int (*fn)(struct device *, void *), void *data)
+{
+ return bus_for_each_dev(&acpi_bus_type, NULL, data, fn);
+}
+EXPORT_SYMBOL_GPL(acpi_bus_for_each_dev);
/* --------------------------------------------------------------------------
Initialization/Cleanup