ACPI: Move acpi_bus_get_device() from bus.c to scan.c
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 30 Jul 2013 12:38:34 +0000 (14:38 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 6 Aug 2013 12:12:22 +0000 (14:12 +0200)
Move acpi_bus_get_device() from bus.c to scan.c which allows
acpi_bus_data_handler() to become static and clean up the latter.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/bus.c
drivers/acpi/scan.c
include/acpi/acpi_bus.h

index 25b289ff42902ba611768f0ba0e3b55bdfd1b151..7df97d27754575b9fb345d6f200629e56c06fe43 100644 (file)
@@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = {
                                 Device Management
    -------------------------------------------------------------------------- */
 
-int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
-{
-       acpi_status status;
-
-       if (!device)
-               return -EINVAL;
-
-       /* TBD: Support fixed-feature devices */
-
-       status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
-       if (ACPI_FAILURE(status) || !*device) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
-                                 handle));
-               return -ENODEV;
-       }
-
-       return 0;
-}
-
-EXPORT_SYMBOL(acpi_bus_get_device);
-
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
                                       unsigned long long *sta)
 {
index 10985573aaa7c680613c1412c958d81d7af22f64..4b2679342e8260b56cb825e36fb457e22c7a2acd 100644 (file)
@@ -997,6 +997,28 @@ struct bus_type acpi_bus_type = {
        .uevent         = acpi_device_uevent,
 };
 
+static void acpi_bus_data_handler(acpi_handle handle, void *context)
+{
+       /* Intentionally empty. */
+}
+
+int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device)
+{
+       acpi_status status;
+
+       if (!device)
+               return -EINVAL;
+
+       status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device);
+       if (ACPI_FAILURE(status) || !*device) {
+               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n",
+                                 handle));
+               return -ENODEV;
+       }
+       return 0;
+}
+EXPORT_SYMBOL_GPL(acpi_bus_get_device);
+
 int acpi_device_add(struct acpi_device *device,
                    void (*release)(struct device *))
 {
@@ -1208,14 +1230,6 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd)
 }
 EXPORT_SYMBOL_GPL(acpi_bus_get_ejd);
 
-void acpi_bus_data_handler(acpi_handle handle, void *context)
-{
-
-       /* TBD */
-
-       return;
-}
-
 static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
                                        struct acpi_device_wakeup *wakeup)
 {
index 2650d1f19e43bf7c5ba897d8f897d596a625d488..2a42cb36d238042172866cb094069e5bc587ab6d 100644 (file)
@@ -363,7 +363,6 @@ extern void unregister_acpi_bus_notifier(struct notifier_block *nb);
  */
 
 int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device);
-void acpi_bus_data_handler(acpi_handle handle, void *context);
 acpi_status acpi_bus_get_status_handle(acpi_handle handle,
                                       unsigned long long *sta);
 int acpi_bus_get_status(struct acpi_device *device);