Skip to contentSkip to conversation

pcmcia: convert to use for_each_pci_bridge() helper

PATCH Superseded Andy Shevchenko 2 participants 2 messages Oct 13, 2017 – Oct 20, 2017

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcmcia: convert to use for_each_pci_bridge() helper

...which makes code slightly cleaner.

Requires: d43f59ce6c50 ("PCI: Add for_each_pci_bridge() helper")

---
 drivers/pcmcia/cardbus.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pcmcia/cardbus.c +2 -3
index 4fe4cc4ae19a..5c0170597037 100644
@@ -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.
Signature · 1 line
2.14.2
#1 lore raw
Quoted 4 lines · Andy Shevchenko

...which makes code slightly cleaner.

Requires: d43f59ce6c50 ("PCI: Add for_each_pci_bridge() helper")

I folded this into the original commit, since it hasn't been merged anywhere. Note that I moved that commit from pci/misc to pci/hotplug since Mika's series depends on it. Thanks!

Quoted 23 lines
---
 drivers/pcmcia/cardbus.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/pcmcia/cardbus.c +2 -3
index 4fe4cc4ae19a..5c0170597037 100644
@@ -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.
Signature · 1 line
2.14.2