aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2009-06-07 18:27:31 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-11 10:36:56 -0400
commitdc890c2dcd63a90de68ee5f0253eefbb89d725f0 (patch)
tree561a3c58647ae9775f7af0a48f56e2255d6eb22d /drivers/serial
parent42578c82e0f1810a07ebe29cb05e874893243d8c (diff)
[ARM] 5544/1: Trust PrimeCell resource sizes
I found the PrimeCell/AMBA Bus drivers distrusting the resource passed in as part of the struct amba_device abstraction. This patch removes all hard coded resource sizes found in the PrimeCell drivers and move the responsibility of this definition back to the platform/board device definition, which already exist and appear to be correct for all in-tree users of these drivers. We do this using the resource_size() inline function which was also replicated in the only driver using the resource size, so that has been changed too. The KMI_SIZE was left in kmi.h in case someone likes it. Test-compiled against Versatile and Integrator defconfigs, seems to work but I don't posess these boards and cannot test them. Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/amba-pl010.c2
-rw-r--r--drivers/serial/amba-pl011.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c
index cdc049d4350..58a4879c7e4 100644
--- a/drivers/serial/amba-pl010.c
+++ b/drivers/serial/amba-pl010.c
@@ -686,7 +686,7 @@ static int pl010_probe(struct amba_device *dev, struct amba_id *id)
686 goto out; 686 goto out;
687 } 687 }
688 688
689 base = ioremap(dev->res.start, PAGE_SIZE); 689 base = ioremap(dev->res.start, resource_size(&dev->res));
690 if (!base) { 690 if (!base) {
691 ret = -ENOMEM; 691 ret = -ENOMEM;
692 goto free; 692 goto free;
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 8c5bda27736..bf82e28770a 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -767,7 +767,7 @@ static int pl011_probe(struct amba_device *dev, struct amba_id *id)
767 goto out; 767 goto out;
768 } 768 }
769 769
770 base = ioremap(dev->res.start, PAGE_SIZE); 770 base = ioremap(dev->res.start, resource_size(&dev->res));
771 if (!base) { 771 if (!base) {
772 ret = -ENOMEM; 772 ret = -ENOMEM;
773 goto free; 773 goto free;