Skip to content

Commit

Permalink
ACPI: Move acpi_bus_get_device() from bus.c to scan.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rafael J. Wysocki committed Aug 6, 2013
1 parent 62eb4b0 commit caf5c03
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 30 deletions.
21 changes: 0 additions & 21 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
30 changes: 22 additions & 8 deletions drivers/acpi/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 *))
{
Expand Down Expand Up @@ -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)
{
Expand Down
1 change: 0 additions & 1 deletion include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit caf5c03

Please sign in to comment.