ACPI/IORT: Remove useless PCI bus walk
authorLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 19 Jun 2020 08:20:05 +0000 (09:20 +0100)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 28 Jul 2020 14:51:31 +0000 (15:51 +0100)
The PCI bus domain number (used in the iort_match_node_callback() -
pci_domain_nr() call) is cascaded through the PCI bus hierarchy at PCI
bus enumeration time, therefore there is no need in iort_find_dev_node()
to walk the PCI bus upwards to grab the root bus to be passed to
iort_scan_node(), the device->bus PCI bus pointer will do.

Remove this useless code.

Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Hanjun Guo <guohanjun@huawei.com>
Cc: Sudeep Holla <sudeep.holla@arm.com>
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Link: https://lore.kernel.org/r/20200619082013.13661-5-lorenzo.pieralisi@arm.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
drivers/acpi/arm64/iort.c

index 53f9ef5150896f2c17138a23786b3e5ca8dfec79..421c6976ab8195b74fb6c7df57f39cf0e65592ce 100644 (file)
@@ -558,10 +558,7 @@ static struct acpi_iort_node *iort_find_dev_node(struct device *dev)
                                      iort_match_node_callback, dev);
        }
 
-       /* Find a PCI root bus */
        pbus = to_pci_dev(dev)->bus;
-       while (!pci_is_root_bus(pbus))
-               pbus = pbus->parent;
 
        return iort_scan_node(ACPI_IORT_NODE_PCI_ROOT_COMPLEX,
                              iort_match_node_callback, &pbus->dev);