diff --git a/arch/arm/mach-u300/gpio.c b/arch/arm/mach-u300/gpio.c index 94837a4e146b64eb2223b3eb23d2a8d2e768bca8..d92790140fe53852bd4e571ed29fe95f490e8e77 100644 --- a/arch/arm/mach-u300/gpio.c +++ b/arch/arm/mach-u300/gpio.c @@ -581,7 +581,8 @@ static int __init gpio_probe(struct platform_device *pdev) if (!memres) goto err_no_resource; - if (!request_mem_region(memres->start, resource_size(memres), "GPIO Controller")) { + if (request_mem_region(memres->start, memres->end - memres->start, "GPIO Controller") + == NULL) { err = -ENODEV; goto err_no_ioregion; } @@ -639,7 +640,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, resource_size(memres)); + release_mem_region(memres->start, memres->end - memres->start); err_no_ioregion: err_no_resource: clk_disable(clk); @@ -659,7 +660,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, resource_size(memres)); + release_mem_region(memres->start, memres->end - memres->start); clk_disable(clk); clk_put(clk); return 0;