aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/52xx
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-06-09 12:13:32 -0400
committerJiri Kosina <jkosina@suse.cz>2011-06-10 08:55:36 -0400
commit28f65c11f2ffb3957259dece647a24f8ad2e241b (patch)
tree6b7621d09d10df89eedd908d4506fb9f457a909f /arch/powerpc/platforms/52xx
parent140a1ef2f91a00e1d25f0878c193abdc25bf6ebe (diff)
treewide: Convert uses of struct resource to resource_size(ptr)
Several fixes as well where the +1 was missing. Done via coccinelle scripts like: @@ struct resource *ptr; @@ - ptr->end - ptr->start + 1 + resource_size(ptr) and some grep and typing. Mostly uncompiled, no cross-compilers. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch/powerpc/platforms/52xx')
-rw-r--r--arch/powerpc/platforms/52xx/mpc52xx_pci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index da110bd88346..5f5e69309080 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -264,7 +264,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
264 (unsigned long long)res->flags); 264 (unsigned long long)res->flags);
265 out_be32(&pci_regs->iw0btar, 265 out_be32(&pci_regs->iw0btar,
266 MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, 266 MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start,
267 res->end - res->start + 1)); 267 resource_size(res)));
268 iwcr0 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM; 268 iwcr0 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM;
269 if (res->flags & IORESOURCE_PREFETCH) 269 if (res->flags & IORESOURCE_PREFETCH)
270 iwcr0 |= MPC52xx_PCI_IWCR_READ_MULTI; 270 iwcr0 |= MPC52xx_PCI_IWCR_READ_MULTI;
@@ -278,7 +278,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
278 res->start, res->end, res->flags); 278 res->start, res->end, res->flags);
279 out_be32(&pci_regs->iw1btar, 279 out_be32(&pci_regs->iw1btar,
280 MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, 280 MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start,
281 res->end - res->start + 1)); 281 resource_size(res)));
282 iwcr1 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM; 282 iwcr1 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_MEM;
283 if (res->flags & IORESOURCE_PREFETCH) 283 if (res->flags & IORESOURCE_PREFETCH)
284 iwcr1 |= MPC52xx_PCI_IWCR_READ_MULTI; 284 iwcr1 |= MPC52xx_PCI_IWCR_READ_MULTI;
@@ -300,7 +300,7 @@ mpc52xx_pci_setup(struct pci_controller *hose,
300 out_be32(&pci_regs->iw2btar, 300 out_be32(&pci_regs->iw2btar,
301 MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys, 301 MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys,
302 res->start, 302 res->start,
303 res->end - res->start + 1)); 303 resource_size(res)));
304 iwcr2 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_IO; 304 iwcr2 = MPC52xx_PCI_IWCR_ENABLE | MPC52xx_PCI_IWCR_IO;
305 305
306 /* Set all the IWCR fields at once; they're in the same reg */ 306 /* Set all the IWCR fields at once; they're in the same reg */
@@ -402,7 +402,7 @@ mpc52xx_add_bridge(struct device_node *node)
402 402
403 hose->ops = &mpc52xx_pci_ops; 403 hose->ops = &mpc52xx_pci_ops;
404 404
405 pci_regs = ioremap(rsrc.start, rsrc.end - rsrc.start + 1); 405 pci_regs = ioremap(rsrc.start, resource_size(&rsrc));
406 if (!pci_regs) 406 if (!pci_regs)
407 return -ENOMEM; 407 return -ENOMEM;
408 408