usb_del_gadget_udc(&r8a66597->gadget);
del_timer_sync(&r8a66597->timer);
- iounmap(r8a66597->reg);
if (r8a66597->pdata->sudmac)
iounmap(r8a66597->sudmac_reg);
free_irq(platform_get_irq(pdev, 0), r8a66597);
unsigned long irq_trigger;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- if (!res) {
- ret = -ENODEV;
- dev_err(&pdev->dev, "platform_get_resource error.\n");
- goto clean_up;
- }
+ reg = devm_ioremap_resource(&pdev->dev, res);
+ if (!reg)
+ return -ENODEV;
ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
irq = ires->start;
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 */
r8a66597 = kzalloc(sizeof(struct r8a66597), GFP_KERNEL);
if (r8a66597 == NULL) {
r8a66597->ep0_req);
kfree(r8a66597);
}
- if (reg)
- iounmap(reg);
return ret;
}