diff options
author | Bjorn Helgaas <bjorn.helgaas@hp.com> | 2010-02-23 12:24:31 -0500 |
---|---|---|
committer | Jesse Barnes <jbarnes@virtuousgeek.org> | 2010-02-23 12:43:31 -0500 |
commit | 89a74ecccd1f78e51faf6287e5c0e93a92ac096e (patch) | |
tree | 6d167d73fb2cf5bb457b0b19145fcbf81cf441ef /arch/powerpc/platforms | |
parent | 2adf75160b10bf3f09ed7d3d04e937f923fc557e (diff) |
PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs
No functional change; this converts loops that iterate from 0 to
PCI_BUS_NUM_RESOURCES through pci_bus resource[] table to use the
pci_bus_for_each_resource() iterator instead.
This doesn't change the way resources are stored; it merely removes
dependencies on the fact that they're in a table.
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/fsl_uli1575.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/powerpc/platforms/fsl_uli1575.c b/arch/powerpc/platforms/fsl_uli1575.c index fd23a1d4b39d..8b0c2082a783 100644 --- a/arch/powerpc/platforms/fsl_uli1575.c +++ b/arch/powerpc/platforms/fsl_uli1575.c | |||
@@ -222,6 +222,7 @@ static void __devinit quirk_final_uli5249(struct pci_dev *dev) | |||
222 | int i; | 222 | int i; |
223 | u8 *dummy; | 223 | u8 *dummy; |
224 | struct pci_bus *bus = dev->bus; | 224 | struct pci_bus *bus = dev->bus; |
225 | struct resource *res; | ||
225 | resource_size_t end = 0; | 226 | resource_size_t end = 0; |
226 | 227 | ||
227 | for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCES+3; i++) { | 228 | for (i = PCI_BRIDGE_RESOURCES; i < PCI_BRIDGE_RESOURCES+3; i++) { |
@@ -230,13 +231,12 @@ static void __devinit quirk_final_uli5249(struct pci_dev *dev) | |||
230 | end = pci_resource_end(dev, i); | 231 | end = pci_resource_end(dev, i); |
231 | } | 232 | } |
232 | 233 | ||
233 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { | 234 | pci_bus_for_each_resource(bus, res, i) { |
234 | if ((bus->resource[i]) && | 235 | if (res && res->flags & IORESOURCE_MEM) { |
235 | (bus->resource[i]->flags & IORESOURCE_MEM)) { | 236 | if (res->end == end) |
236 | if (bus->resource[i]->end == end) | 237 | dummy = ioremap(res->start, 0x4); |
237 | dummy = ioremap(bus->resource[i]->start, 0x4); | ||
238 | else | 238 | else |
239 | dummy = ioremap(bus->resource[i]->end - 3, 0x4); | 239 | dummy = ioremap(res->end - 3, 0x4); |
240 | if (dummy) { | 240 | if (dummy) { |
241 | in_8(dummy); | 241 | in_8(dummy); |
242 | iounmap(dummy); | 242 | iounmap(dummy); |