summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/glue.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-11-28 23:58:08 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-12-07 01:05:48 +0100
commit5ce79d201358d36f13d13b01d8614bd8e646036c (patch)
treef3e41f23b317e892287cb233c86b942e9e513786 /drivers/acpi/glue.c
parentACPI / bind: Simplify child device lookups (diff)
downloadlinux-5ce79d201358d36f13d13b01d8614bd8e646036c.tar.xz
linux-5ce79d201358d36f13d13b01d8614bd8e646036c.zip
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,
struct acpi_device *adev, *ret = NULL;
int ret_score = 0;
+ if (!parent)
+ return NULL;
+
list_for_each_entry(adev, &parent->children, node) {
unsigned long long addr;
acpi_status status;