aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/at91_udc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/at91_udc.c')
-rw-r--r--drivers/usb/gadget/at91_udc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 043e04db2a0..12ac9cd32a0 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1656,9 +1656,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
1656 if (!res) 1656 if (!res)
1657 return -ENXIO; 1657 return -ENXIO;
1658 1658
1659 if (!request_mem_region(res->start, 1659 if (!request_mem_region(res->start, resource_size(res), driver_name)) {
1660 res->end - res->start + 1,
1661 driver_name)) {
1662 DBG("someone's using UDC memory\n"); 1660 DBG("someone's using UDC memory\n");
1663 return -EBUSY; 1661 return -EBUSY;
1664 } 1662 }
@@ -1699,7 +1697,7 @@ static int __init at91udc_probe(struct platform_device *pdev)
1699 udc->ep[3].maxpacket = 64; 1697 udc->ep[3].maxpacket = 64;
1700 } 1698 }
1701 1699
1702 udc->udp_baseaddr = ioremap(res->start, res->end - res->start + 1); 1700 udc->udp_baseaddr = ioremap(res->start, resource_size(res));
1703 if (!udc->udp_baseaddr) { 1701 if (!udc->udp_baseaddr) {
1704 retval = -ENOMEM; 1702 retval = -ENOMEM;
1705 goto fail0a; 1703 goto fail0a;
@@ -1781,7 +1779,7 @@ fail0a:
1781 if (cpu_is_at91rm9200()) 1779 if (cpu_is_at91rm9200())
1782 gpio_free(udc->board.pullup_pin); 1780 gpio_free(udc->board.pullup_pin);
1783fail0: 1781fail0:
1784 release_mem_region(res->start, res->end - res->start + 1); 1782 release_mem_region(res->start, resource_size(res));
1785 DBG("%s probe failed, %d\n", driver_name, retval); 1783 DBG("%s probe failed, %d\n", driver_name, retval);
1786 return retval; 1784 return retval;
1787} 1785}
@@ -1813,7 +1811,7 @@ static int __exit at91udc_remove(struct platform_device *pdev)
1813 gpio_free(udc->board.pullup_pin); 1811 gpio_free(udc->board.pullup_pin);
1814 1812
1815 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1813 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1816 release_mem_region(res->start, res->end - res->start + 1); 1814 release_mem_region(res->start, resource_size(res));
1817 1815
1818 clk_put(udc->iclk); 1816 clk_put(udc->iclk);
1819 clk_put(udc->fclk); 1817 clk_put(udc->fclk);