[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>
This commit is contained in:
committed by
Russell King
parent
42578c82e0
commit
dc890c2dcd
@@ -135,7 +135,7 @@ static int amba_kmi_probe(struct amba_device *dev, struct amba_id *id)
|
||||
io->dev.parent = &dev->dev;
|
||||
|
||||
kmi->io = io;
|
||||
kmi->base = ioremap(dev->res.start, KMI_SIZE);
|
||||
kmi->base = ioremap(dev->res.start, resource_size(&dev->res));
|
||||
if (!kmi->base) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user