diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-14 21:22:45 (GMT) |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-14 21:22:45 (GMT) |
commit | f3ce717e60572421f56d89c9a85ac42e634d16e7 (patch) | |
tree | 46b85329773c7908378f90e4e8e86205ebfd229f /drivers/acpi/scan.c | |
parent | d4e4ab86bcba5a72779c43dc1459f71fea3d89c8 (diff) | |
parent | e73d3136355f511d3e1c2ef21acf02b19bd2b650 (diff) | |
download | linux-f3ce717e60572421f56d89c9a85ac42e634d16e7.tar.xz |
Merge back earlier 'acpi-assorted' material
Diffstat (limited to 'drivers/acpi/scan.c')
-rw-r--r-- | drivers/acpi/scan.c | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 8a46c92..7d9e285 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -999,6 +999,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 *)) { @@ -1210,14 +1232,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) { |