]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
powerpc/pci: Use for_each_pci_bridge() helper
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 10 Nov 2017 17:52:29 +0000 (19:52 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 19 Dec 2017 05:05:52 +0000 (23:05 -0600)
Use for_each_pci_bridge() helper to make the code slightly cleaner.  No
functional change intended.

Requires: 24a0c654d7d6 ("PCI: Add for_each_pci_bridge() helper")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/pci-hotplug.c
arch/powerpc/kernel/pci_of_scan.c

index 2d71269e7dc108f3eb0d26e24b011ed57fecc35d..741f47295188c2bbabee7184e46e7b4f5a4076cd 100644 (file)
@@ -134,11 +134,8 @@ void pci_hp_add_devices(struct pci_bus *bus)
                pcibios_setup_bus_devices(bus);
                max = bus->busn_res.start;
                for (pass = 0; pass < 2; pass++) {
-                       list_for_each_entry(dev, &bus->devices, bus_list) {
-                               if (pci_is_bridge(dev))
-                                       max = pci_scan_bridge(bus, dev,
-                                                             max, pass);
-                       }
+                       for_each_pci_bridge(dev, bus)
+                               max = pci_scan_bridge(bus, dev, max, pass);
                }
        }
        pcibios_finish_adding_to_bus(bus);
index 0d790f8432d27b6293c647176984d45f792c72c6..8bdaa2a6fa62acad45bf83be8587f0e2aefbc8a4 100644 (file)
@@ -369,11 +369,8 @@ static void __of_scan_bus(struct device_node *node, struct pci_bus *bus,
        pcibios_setup_bus_devices(bus);
 
        /* Now scan child busses */
-       list_for_each_entry(dev, &bus->devices, bus_list) {
-               if (pci_is_bridge(dev)) {
-                       of_scan_pci_bridge(dev);
-               }
-       }
+       for_each_pci_bridge(dev, bus)
+               of_scan_pci_bridge(dev);
 }
 
 /**