aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-28 17:58:28 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-12-06 19:05:49 -0500
commit9c5ad36d987a1b06f6b0b9dc7bc61a45d277455d (patch)
treef62910cb67ab6912ae1d753a0940f76bb3f47e00 /drivers/acpi
parent11dcc75dba5bf8b69c4612de10e366c4e04cb123 (diff)
ACPI / bind: Redefine acpi_preset_companion()
Modify acpi_preset_companion() to take a struct acpi_device pointer instead of an ACPI handle as its second argument and redefine it as a static inline wrapper around ACPI_COMPANION_SET() passing the return value of acpi_find_child_device() directly as the second argument to it. Update its users to pass struct acpi_device pointers instead of ACPI handles to it. This allows some unnecessary acpi_bus_get_device() calls to be avoided. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com> Tested-by: Aaron Lu <aaron.lu@intel.com> # for ATA binding
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/glue.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index 12b2acbaa116..c0d18b2145c1 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -149,6 +149,7 @@ struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
149 } 149 }
150 return ret; 150 return ret;
151} 151}
152EXPORT_SYMBOL_GPL(acpi_find_child_device);
152 153
153acpi_handle acpi_get_child(acpi_handle handle, u64 addr) 154acpi_handle acpi_get_child(acpi_handle handle, u64 addr)
154{ 155{
@@ -298,15 +299,6 @@ int acpi_unbind_one(struct device *dev)
298} 299}
299EXPORT_SYMBOL_GPL(acpi_unbind_one); 300EXPORT_SYMBOL_GPL(acpi_unbind_one);
300 301
301void acpi_preset_companion(struct device *dev, acpi_handle parent, u64 addr)
302{
303 struct acpi_device *adev;
304
305 if (!acpi_bus_get_device(acpi_get_child(parent, addr), &adev))
306 ACPI_COMPANION_SET(dev, adev);
307}
308EXPORT_SYMBOL_GPL(acpi_preset_companion);
309
310static int acpi_platform_notify(struct device *dev) 302static int acpi_platform_notify(struct device *dev)
311{ 303{
312 struct acpi_bus_type *type = acpi_get_bus_type(dev); 304 struct acpi_bus_type *type = acpi_get_bus_type(dev);