mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
PCI: Add for_each_pci_bridge() helper
The following pattern is often used:
list_for_each_entry(dev, &bus->devices, bus_list) {
if (pci_is_bridge(dev)) {
...
}
}
Add a for_each_pci_bridge() helper to make that code easier to write and
read by reducing indentation level. It also saves one or few lines of code
in each occurrence.
Convert PCI core parts here at the same time.
Signed-off-by: Andy Shevchenko <[email protected]>
[bhelgaas: fold in http://lkml.kernel.org/r/[email protected]]
Signed-off-by: Bjorn Helgaas <[email protected]>
This commit is contained in:
parent
3691314a90
commit
24a0c654d7
8 changed files with 23 additions and 32 deletions
|
|
@ -77,9 +77,8 @@ int __ref cb_alloc(struct pcmcia_socket *s)
|
|||
|
||||
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);
|
||||
|
||||
/*
|
||||
* Size all resources below the CardBus controller.
|
||||
|
|
|
|||
Loading…
Reference in a new issue