Commit d8bb0fd2 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

USB: at91_udc.c: use resource_size()

Use resource_size().
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 3ba37bda
...@@ -1656,9 +1656,7 @@ static int __init at91udc_probe(struct platform_device *pdev) ...@@ -1656,9 +1656,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
if (!res) if (!res)
return -ENXIO; return -ENXIO;
if (!request_mem_region(res->start, if (!request_mem_region(res->start, resource_size(res), driver_name)) {
res->end - res->start + 1,
driver_name)) {
DBG("someone's using UDC memory\n"); DBG("someone's using UDC memory\n");
return -EBUSY; return -EBUSY;
} }
...@@ -1699,7 +1697,7 @@ static int __init at91udc_probe(struct platform_device *pdev) ...@@ -1699,7 +1697,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
udc->ep[3].maxpacket = 64; udc->ep[3].maxpacket = 64;
} }
udc->udp_baseaddr = ioremap(res->start, res->end - res->start + 1); udc->udp_baseaddr = ioremap(res->start, resource_size(res));
if (!udc->udp_baseaddr) { if (!udc->udp_baseaddr) {
retval = -ENOMEM; retval = -ENOMEM;
goto fail0a; goto fail0a;
...@@ -1781,7 +1779,7 @@ static int __init at91udc_probe(struct platform_device *pdev) ...@@ -1781,7 +1779,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
if (cpu_is_at91rm9200()) if (cpu_is_at91rm9200())
gpio_free(udc->board.pullup_pin); gpio_free(udc->board.pullup_pin);
fail0: fail0:
release_mem_region(res->start, res->end - res->start + 1); release_mem_region(res->start, resource_size(res));
DBG("%s probe failed, %d\n", driver_name, retval); DBG("%s probe failed, %d\n", driver_name, retval);
return retval; return retval;
} }
...@@ -1813,7 +1811,7 @@ static int __exit at91udc_remove(struct platform_device *pdev) ...@@ -1813,7 +1811,7 @@ static int __exit at91udc_remove(struct platform_device *pdev)
gpio_free(udc->board.pullup_pin); gpio_free(udc->board.pullup_pin);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(res->start, res->end - res->start + 1); release_mem_region(res->start, resource_size(res));
clk_put(udc->iclk); clk_put(udc->iclk);
clk_put(udc->fclk); clk_put(udc->fclk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment