aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
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/rtc
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/rtc')
-rw-r--r--drivers/rtc/rtc-pl030.c2
-rw-r--r--drivers/rtc/rtc-pl031.c3
2 files changed, 2 insertions, 3 deletions
diff --git a/drivers/rtc/rtc-pl030.c b/drivers/rtc/rtc-pl030.c
index aaf1f75fa293..457231bb1029 100644
--- a/drivers/rtc/rtc-pl030.c
+++ b/drivers/rtc/rtc-pl030.c
@@ -117,7 +117,7 @@ static int pl030_probe(struct amba_device *dev, struct amba_id *id)
117 goto err_rtc; 117 goto err_rtc;
118 } 118 }
119 119
120 rtc->base = ioremap(dev->res.start, SZ_4K); 120 rtc->base = ioremap(dev->res.start, resource_size(&dev->res));
121 if (!rtc->base) { 121 if (!rtc->base) {
122 ret = -ENOMEM; 122 ret = -ENOMEM;
123 goto err_map; 123 goto err_map;
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 451fc13784d1..f41873f98f66 100644
--- a/drivers/rtc/rtc-pl031.c
+++ b/drivers/rtc/rtc-pl031.c
@@ -142,8 +142,7 @@ static int pl031_probe(struct amba_device *adev, struct amba_id *id)
142 goto out; 142 goto out;
143 } 143 }
144 144
145 ldata->base = ioremap(adev->res.start, 145 ldata->base = ioremap(adev->res.start, resource_size(&adev->res));
146 adev->res.end - adev->res.start + 1);
147 if (!ldata->base) { 146 if (!ldata->base) {
148 ret = -ENOMEM; 147 ret = -ENOMEM;
149 goto out_no_remap; 148 goto out_no_remap;