]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
microblaze: PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs
authorMichal Simek <monstr@monstr.eu>
Fri, 16 Apr 2010 07:03:00 +0000 (09:03 +0200)
committerMichal Simek <monstr@monstr.eu>
Thu, 6 May 2010 09:21:57 +0000 (11:21 +0200)
This change should be part of 89a74ecccd1f78e51faf6287e5c0e93a92ac096e

Origin description:

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: Michal Simek <monstr@monstr.eu>
arch/microblaze/pci/pci-common.c

index 740bb32ec57ea30d9d266e4131dbe2037b2db0b4..5e569fa9b87b2c38b73135d63743522281eaf307 100644 (file)
@@ -1025,7 +1025,7 @@ static void __devinit pcibios_fixup_bridge(struct pci_bus *bus)
 
        struct pci_dev *dev = bus->self;
 
-       for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
+       pci_bus_for_each_resource(bus, res, i) {
                res = bus->resource[i];
                if (!res)
                        continue;
@@ -1228,7 +1228,7 @@ void pcibios_allocate_bus_resources(struct pci_bus *bus)
        pr_debug("PCI: Allocating bus resources for %04x:%02x...\n",
                 pci_domain_nr(bus), bus->number);
 
-       for (i = 0; i < PCI_BUS_NUM_RESOURCES; ++i) {
+       pci_bus_for_each_resource(bus, res, i) {
                res = bus->resource[i];
                if (!res || !res->flags
                    || res->start > res->end || res->parent)