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 /drivers/pci/bus.c | |
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 'drivers/pci/bus.c')
-rw-r--r-- | drivers/pci/bus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index a26135bb0ffd..e75d219fd107 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -43,6 +43,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
43 | void *alignf_data) | 43 | void *alignf_data) |
44 | { | 44 | { |
45 | int i, ret = -ENOMEM; | 45 | int i, ret = -ENOMEM; |
46 | struct resource *r; | ||
46 | resource_size_t max = -1; | 47 | resource_size_t max = -1; |
47 | 48 | ||
48 | type_mask |= IORESOURCE_IO | IORESOURCE_MEM; | 49 | type_mask |= IORESOURCE_IO | IORESOURCE_MEM; |
@@ -51,8 +52,7 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
51 | if (!(res->flags & IORESOURCE_MEM_64)) | 52 | if (!(res->flags & IORESOURCE_MEM_64)) |
52 | max = PCIBIOS_MAX_MEM_32; | 53 | max = PCIBIOS_MAX_MEM_32; |
53 | 54 | ||
54 | for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { | 55 | pci_bus_for_each_resource(bus, r, i) { |
55 | struct resource *r = bus->resource[i]; | ||
56 | if (!r) | 56 | if (!r) |
57 | continue; | 57 | continue; |
58 | 58 | ||