summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-03-23 12:55:37 -0700
committerJiri Kosina <jkosina@suse.cz>2011-04-10 17:01:04 +0200
commitb0c3af5ef0d7b38eb1ba522becd47123ac9736d2 (patch)
tree01d3222cd3fe0d8204bc69569087db85cbd24867 /arch
parent99172a2f9edb3517f610fb93356a6a6a0c30f0c8 (diff)
downloadop-kernel-dev-b0c3af5ef0d7b38eb1ba522becd47123ac9736d2.zip
op-kernel-dev-b0c3af5ef0d7b38eb1ba522becd47123ac9736d2.tar.gz
arm: mach-u300/gpio: Fix mem_region resource size miscalculations
Convert off-by-1 r->end - r->start to resource_size(r) Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-u300/gpio.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c
index d927901..94837a4 100644
--- a/arch/arm/mach-u300/gpio.c
+++ b/arch/arm/mach-u300/gpio.c
@@ -581,8 +581,7 @@ static int __init gpio_probe(struct platform_device *pdev)
if (!memres)
goto err_no_resource;
- if (request_mem_region(memres->start, memres->end - memres->start, "GPIO Controller")
- == NULL) {
+ if (!request_mem_region(memres->start, resource_size(memres), "GPIO Controller")) {
err = -ENODEV;
goto err_no_ioregion;
}
@@ -640,7 +639,7 @@ static int __init gpio_probe(struct platform_device *pdev)
free_irq(gpio_ports[i].irq, &gpio_ports[i]);
iounmap(virtbase);
err_no_ioremap:
- release_mem_region(memres->start, memres->end - memres->start);
+ release_mem_region(memres->start, resource_size(memres));
err_no_ioregion:
err_no_resource:
clk_disable(clk);
@@ -660,7 +659,7 @@ static int __exit gpio_remove(struct platform_device *pdev)
for (i = 0 ; i < U300_GPIO_NUM_PORTS; i++)
free_irq(gpio_ports[i].irq, &gpio_ports[i]);
iounmap(virtbase);
- release_mem_region(memres->start, memres->end - memres->start);
+ release_mem_region(memres->start, resource_size(memres));
clk_disable(clk);
clk_put(clk);
return 0;
OpenPOWER on IntegriCloud