diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-29 10:27:43 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-12-06 19:05:50 -0500 |
commit | 24dee1fc99fd6d38fc859d7f6dda1dab21493bef (patch) | |
tree | 1377d90f45c045fdae001a580008cddcb03e4c8d /drivers/acpi/glue.c | |
parent | e3f02c5228c4b600abf6ca243301176f25553bd5 (diff) |
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 <rafael.j.wysocki@intel.com>
Tested-by: Lan Tianyu <tianyu.lan@intel.com> # for USB/ACPI
Diffstat (limited to 'drivers/acpi/glue.c')
-rw-r--r-- | drivers/acpi/glue.c | 9 |
1 files changed, 3 insertions, 6 deletions
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) | |||
172 | strcpy(buf, PHYSICAL_NODE_STRING); | 172 | strcpy(buf, PHYSICAL_NODE_STRING); |
173 | } | 173 | } |
174 | 174 | ||
175 | int acpi_bind_one(struct device *dev, acpi_handle handle) | 175 | int acpi_bind_one(struct device *dev, struct acpi_device *acpi_dev) |
176 | { | 176 | { |
177 | struct acpi_device *acpi_dev = NULL; | ||
178 | struct acpi_device_physical_node *physical_node, *pn; | 177 | struct acpi_device_physical_node *physical_node, *pn; |
179 | char physical_node_name[PHYSICAL_NODE_NAME_SIZE]; | 178 | char physical_node_name[PHYSICAL_NODE_NAME_SIZE]; |
180 | struct list_head *physnode_list; | 179 | struct list_head *physnode_list; |
@@ -182,14 +181,12 @@ int acpi_bind_one(struct device *dev, acpi_handle handle) | |||
182 | int retval = -EINVAL; | 181 | int retval = -EINVAL; |
183 | 182 | ||
184 | if (ACPI_COMPANION(dev)) { | 183 | if (ACPI_COMPANION(dev)) { |
185 | if (handle) { | 184 | if (acpi_dev) { |
186 | dev_warn(dev, "ACPI companion already set\n"); | 185 | dev_warn(dev, "ACPI companion already set\n"); |
187 | return -EINVAL; | 186 | return -EINVAL; |
188 | } else { | 187 | } else { |
189 | acpi_dev = ACPI_COMPANION(dev); | 188 | acpi_dev = ACPI_COMPANION(dev); |
190 | } | 189 | } |
191 | } else { | ||
192 | acpi_bus_get_device(handle, &acpi_dev); | ||
193 | } | 190 | } |
194 | if (!acpi_dev) | 191 | if (!acpi_dev) |
195 | return -EINVAL; | 192 | return -EINVAL; |
@@ -314,7 +311,7 @@ static int acpi_platform_notify(struct device *dev) | |||
314 | ret = -ENODEV; | 311 | ret = -ENODEV; |
315 | goto out; | 312 | goto out; |
316 | } | 313 | } |
317 | ret = acpi_bind_one(dev, adev->handle); | 314 | ret = acpi_bind_one(dev, adev); |
318 | if (ret) | 315 | if (ret) |
319 | goto out; | 316 | goto out; |
320 | } | 317 | } |