diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-30 08:38:34 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-06 08:12:22 -0400 |
commit | caf5c03f17c33a14ef0e7033000f89e4d0910f5a (patch) | |
tree | 865cfa34ccab254249b1b960f912aecfad47ae5e | |
parent | 62eb4b07f0803d0426eb695bfe6755dd6a2cafb2 (diff) |
ACPI: Move acpi_bus_get_device() from bus.c to scan.c
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>
-rw-r--r-- | drivers/acpi/bus.c | 21 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 30 | ||||
-rw-r--r-- | include/acpi/acpi_bus.h | 1 |
3 files changed, 22 insertions, 30 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 25b289ff4290..7df97d277545 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -89,27 +89,6 @@ static struct dmi_system_id dsdt_dmi_table[] __initdata = { | |||
89 | Device Management | 89 | Device Management |
90 | -------------------------------------------------------------------------- */ | 90 | -------------------------------------------------------------------------- */ |
91 | 91 | ||
92 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) | ||
93 | { | ||
94 | acpi_status status; | ||
95 | |||
96 | if (!device) | ||
97 | return -EINVAL; | ||
98 | |||
99 | /* TBD: Support fixed-feature devices */ | ||
100 | |||
101 | status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device); | ||
102 | if (ACPI_FAILURE(status) || !*device) { | ||
103 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n", | ||
104 | handle)); | ||
105 | return -ENODEV; | ||
106 | } | ||
107 | |||
108 | return 0; | ||
109 | } | ||
110 | |||
111 | EXPORT_SYMBOL(acpi_bus_get_device); | ||
112 | |||
113 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 92 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
114 | unsigned long long *sta) | 93 | unsigned long long *sta) |
115 | { | 94 | { |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 10985573aaa7..4b2679342e82 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -997,6 +997,28 @@ struct bus_type acpi_bus_type = { | |||
997 | .uevent = acpi_device_uevent, | 997 | .uevent = acpi_device_uevent, |
998 | }; | 998 | }; |
999 | 999 | ||
1000 | static void acpi_bus_data_handler(acpi_handle handle, void *context) | ||
1001 | { | ||
1002 | /* Intentionally empty. */ | ||
1003 | } | ||
1004 | |||
1005 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device) | ||
1006 | { | ||
1007 | acpi_status status; | ||
1008 | |||
1009 | if (!device) | ||
1010 | return -EINVAL; | ||
1011 | |||
1012 | status = acpi_get_data(handle, acpi_bus_data_handler, (void **)device); | ||
1013 | if (ACPI_FAILURE(status) || !*device) { | ||
1014 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No context for object [%p]\n", | ||
1015 | handle)); | ||
1016 | return -ENODEV; | ||
1017 | } | ||
1018 | return 0; | ||
1019 | } | ||
1020 | EXPORT_SYMBOL_GPL(acpi_bus_get_device); | ||
1021 | |||
1000 | int acpi_device_add(struct acpi_device *device, | 1022 | int acpi_device_add(struct acpi_device *device, |
1001 | void (*release)(struct device *)) | 1023 | void (*release)(struct device *)) |
1002 | { | 1024 | { |
@@ -1208,14 +1230,6 @@ acpi_bus_get_ejd(acpi_handle handle, acpi_handle *ejd) | |||
1208 | } | 1230 | } |
1209 | EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); | 1231 | EXPORT_SYMBOL_GPL(acpi_bus_get_ejd); |
1210 | 1232 | ||
1211 | void acpi_bus_data_handler(acpi_handle handle, void *context) | ||
1212 | { | ||
1213 | |||
1214 | /* TBD */ | ||
1215 | |||
1216 | return; | ||
1217 | } | ||
1218 | |||
1219 | static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, | 1233 | static int acpi_bus_extract_wakeup_device_power_package(acpi_handle handle, |
1220 | struct acpi_device_wakeup *wakeup) | 1234 | struct acpi_device_wakeup *wakeup) |
1221 | { | 1235 | { |
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 2650d1f19e43..2a42cb36d238 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -363,7 +363,6 @@ extern void unregister_acpi_bus_notifier(struct notifier_block *nb); | |||
363 | */ | 363 | */ |
364 | 364 | ||
365 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); | 365 | int acpi_bus_get_device(acpi_handle handle, struct acpi_device **device); |
366 | void acpi_bus_data_handler(acpi_handle handle, void *context); | ||
367 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 366 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
368 | unsigned long long *sta); | 367 | unsigned long long *sta); |
369 | int acpi_bus_get_status(struct acpi_device *device); | 368 | int acpi_bus_get_status(struct acpi_device *device); |