diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-11-28 17:58:08 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-12-06 19:05:48 -0500 |
commit | 5ce79d201358d36f13d13b01d8614bd8e646036c (patch) | |
tree | f3e41f23b317e892287cb233c86b942e9e513786 /drivers/acpi/glue.c | |
parent | d9fef0c4d2e08c3888add77f1dc54fb12afb3928 (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.c | 3 |
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; |