From 24dee1fc99fd6d38fc859d7f6dda1dab21493bef Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 29 Nov 2013 16:27:43 +0100 Subject: ACPI / bind: Pass struct acpi_device pointer to acpi_bind_one() There is no reason to pass an ACPI handle to acpi_bind_one() instead of a struct acpi_device pointer to the target device object, so modify that function to take a struct acpi_device pointer as its second argument and update all code depending on it accordingly. Signed-off-by: Rafael J. Wysocki Tested-by: Lan Tianyu # for USB/ACPI --- drivers/acpi/glue.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/acpi/glue.c') diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c index 7608d66f289b..896351b9d483 100644 --- a/drivers/acpi/glue.c +++ b/drivers/acpi/glue.c @@ -172,9 +172,8 @@ static void acpi_physnode_link_name(char *buf, unsigned int node_id) strcpy(buf, PHYSICAL_NODE_STRING); } -int acpi_bind_one(struct device *dev, acpi_handle handle) +int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) { - struct acpi_device *acpi_dev = NULL; struct acpi_device_physical_node *physical_node, *pn; char physical_node_name[PHYSICAL_NODE_NAME_SIZE]; struct list_head *physnode_list; @@ -182,14 +181,12 @@ int acpi_bind_one(struct device *dev, acpi_handle handle) int retval = -EINVAL; if (ACPI_COMPANION(dev)) { - if (handle) { + if (acpi_dev) { dev_warn(dev, "ACPI companion already set\n"); return -EINVAL; } else { acpi_dev = ACPI_COMPANION(dev); } - } else { - acpi_bus_get_device(handle, &acpi_dev); } if (!acpi_dev) return -EINVAL; @@ -314,7 +311,7 @@ static int acpi_platform_notify(struct device *dev) ret = -ENODEV; goto out; } - ret = acpi_bind_one(dev, adev->handle); + ret = acpi_bind_one(dev, adev); if (ret) goto out; } -- cgit v1.2.3