Commit e1815053 authored by Ben Dooks's avatar Ben Dooks Committed by Felipe Balbi

usb: gadget: r8a66597-udc: use devm_ioremap_resource() for registers

trivial patch removing boilerplate clode.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent ca118b78
...@@ -1826,7 +1826,6 @@ static int __exit r8a66597_remove(struct platform_device *pdev) ...@@ -1826,7 +1826,6 @@ static int __exit r8a66597_remove(struct platform_device *pdev)
usb_del_gadget_udc(&r8a66597->gadget); usb_del_gadget_udc(&r8a66597->gadget);
del_timer_sync(&r8a66597->timer); del_timer_sync(&r8a66597->timer);
iounmap(r8a66597->reg);
if (r8a66597->pdata->sudmac) if (r8a66597->pdata->sudmac)
iounmap(r8a66597->sudmac_reg); iounmap(r8a66597->sudmac_reg);
free_irq(platform_get_irq(pdev, 0), r8a66597); free_irq(platform_get_irq(pdev, 0), r8a66597);
...@@ -1877,11 +1876,9 @@ static int __init r8a66597_probe(struct platform_device *pdev) ...@@ -1877,11 +1876,9 @@ static int __init r8a66597_probe(struct platform_device *pdev)
unsigned long irq_trigger; unsigned long irq_trigger;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) { reg = devm_ioremap_resource(&pdev->dev, res);
ret = -ENODEV; if (!reg)
dev_err(&pdev->dev, "platform_get_resource error.\n"); return -ENODEV;
goto clean_up;
}
ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0); ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
irq = ires->start; irq = ires->start;
...@@ -1893,13 +1890,6 @@ static int __init r8a66597_probe(struct platform_device *pdev) ...@@ -1893,13 +1890,6 @@ static int __init r8a66597_probe(struct platform_device *pdev)
goto clean_up; goto clean_up;
} }
reg = ioremap(res->start, resource_size(res));
if (reg == NULL) {
ret = -ENOMEM;
dev_err(&pdev->dev, "ioremap error.\n");
goto clean_up;
}
/* initialize ucd */ /* initialize ucd */
r8a66597 = kzalloc(sizeof(struct r8a66597), GFP_KERNEL); r8a66597 = kzalloc(sizeof(struct r8a66597), GFP_KERNEL);
if (r8a66597 == NULL) { if (r8a66597 == NULL) {
...@@ -2007,8 +1997,6 @@ static int __init r8a66597_probe(struct platform_device *pdev) ...@@ -2007,8 +1997,6 @@ static int __init r8a66597_probe(struct platform_device *pdev)
r8a66597->ep0_req); r8a66597->ep0_req);
kfree(r8a66597); kfree(r8a66597);
} }
if (reg)
iounmap(reg);
return ret; return ret;
} }
......
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