aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2010-02-23 12:24:31 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-02-23 12:43:31 -0500
commit89a74ecccd1f78e51faf6287e5c0e93a92ac096e (patch)
tree6d167d73fb2cf5bb457b0b19145fcbf81cf441ef /drivers/pcmcia
parent2adf75160b10bf3f09ed7d3d04e937f923fc557e (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/pcmcia')
-rw-r--r--drivers/pcmcia/rsrc_nonstatic.c3
-rw-r--r--drivers/pcmcia/yenta_socket.c5
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/pcmcia/rsrc_nonstatic.c b/drivers/pcmcia/rsrc_nonstatic.c
index 45d75dc452f0..c67638fe6914 100644
--- a/drivers/pcmcia/rsrc_nonstatic.c
+++ b/drivers/pcmcia/rsrc_nonstatic.c
@@ -803,8 +803,7 @@ static int nonstatic_autoadd_resources(struct pcmcia_socket *s)
803 return -EINVAL; 803 return -EINVAL;
804#endif 804#endif
805 805
806 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 806 pci_bus_for_each_resource(s->cb_dev->bus, res, i) {
807 res = s->cb_dev->bus->resource[i];
808 if (!res) 807 if (!res)
809 continue; 808 continue;
810 809
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
index e4d12acdd525..1f2039d5e966 100644
--- a/drivers/pcmcia/yenta_socket.c
+++ b/drivers/pcmcia/yenta_socket.c
@@ -649,9 +649,10 @@ static int yenta_search_one_res(struct resource *root, struct resource *res,
649static int yenta_search_res(struct yenta_socket *socket, struct resource *res, 649static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
650 u32 min) 650 u32 min)
651{ 651{
652 struct resource *root;
652 int i; 653 int i;
653 for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) { 654
654 struct resource *root = socket->dev->bus->resource[i]; 655 pci_bus_for_each_resource(socket->dev->bus, root, i) {
655 if (!root) 656 if (!root)
656 continue; 657 continue;
657 658