summaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-pl031.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2009-06-07 23:27:31 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-11 15:36:56 +0100
commitdc890c2dcd63a90de68ee5f0253eefbb89d725f0 (patch)
tree561a3c58647ae9775f7af0a48f56e2255d6eb22d /drivers/rtc/rtc-pl031.c
parent42578c82e0f1810a07ebe29cb05e874893243d8c (diff)
downloadop-kernel-dev-dc890c2dcd63a90de68ee5f0253eefbb89d725f0.zip
op-kernel-dev-dc890c2dcd63a90de68ee5f0253eefbb89d725f0.tar.gz
[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/rtc-pl031.c')
-rw-r--r--drivers/rtc/rtc-pl031.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c
index 451fc13..f41873f 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)
goto out;
}
- ldata->base = ioremap(adev->res.start,
- adev->res.end - adev->res.start + 1);
+ ldata->base = ioremap(adev->res.start, resource_size(&adev->res));
if (!ldata->base) {
ret = -ENOMEM;
goto out_no_remap;
OpenPOWER on IntegriCloud