aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/glue.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-28 17:58:08 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-12-06 19:05:48 -0500
commit5ce79d201358d36f13d13b01d8614bd8e646036c (patch)
treef3e41f23b317e892287cb233c86b942e9e513786 /drivers/acpi/glue.c
parentd9fef0c4d2e08c3888add77f1dc54fb12afb3928 (diff)
PCI / ACPI: Use acpi_find_child_device() for child devices lookup
It is much more efficient to use acpi_find_child_device() for child devices lookup in acpi_pci_find_device() and pass ACPI_COMPANION(dev->parent) to it directly instead of obtaining ACPI_HANDLE() of ACPI_COMPANION(dev->parent) and passing it to acpi_find_child() which has to run acpi_bus_get_device() to obtain ACPI_COMPANION(dev->parent) from that again. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Aaron Lu <aaron.lu@intel.com>
Diffstat (limited to 'drivers/acpi/glue.c')
-rw-r--r--drivers/acpi/glue.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/glue.c b/drivers/acpi/glue.c
index ea77512ad70c..9d200d5029ca 100644
--- a/drivers/acpi/glue.c
+++ b/drivers/acpi/glue.c
@@ -106,6 +106,9 @@ struct acpi_device *acpi_find_child_device(struct acpi_device *parent,
106 struct acpi_device *adev, *ret = NULL; 106 struct acpi_device *adev, *ret = NULL;
107 int ret_score = 0; 107 int ret_score = 0;
108 108
109 if (!parent)
110 return NULL;
111
109 list_for_each_entry(adev, &parent->children, node) { 112 list_for_each_entry(adev, &parent->children, node) {
110 unsigned long long addr; 113 unsigned long long addr;
111 acpi_status status; 114 acpi_status status;