mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-02 17:26:42 +09:00
usb: gadget: imx_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some boilerplate code. Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
@@ -1461,15 +1461,10 @@ static int __init imx_udc_probe(struct platform_device *pdev)
|
||||
imx_usb->clk = clk;
|
||||
imx_usb->dev = &pdev->dev;
|
||||
|
||||
device_initialize(&imx_usb->gadget.dev);
|
||||
|
||||
imx_usb->gadget.register_my_device = true;
|
||||
imx_usb->gadget.dev.parent = &pdev->dev;
|
||||
imx_usb->gadget.dev.dma_mask = pdev->dev.dma_mask;
|
||||
|
||||
ret = device_add(&imx_usb->gadget.dev);
|
||||
if (retval)
|
||||
goto fail4;
|
||||
|
||||
platform_set_drvdata(pdev, imx_usb);
|
||||
|
||||
usb_init_data(imx_usb);
|
||||
@@ -1481,11 +1476,9 @@ static int __init imx_udc_probe(struct platform_device *pdev)
|
||||
|
||||
ret = usb_add_gadget_udc(&pdev->dev, &imx_usb->gadget);
|
||||
if (ret)
|
||||
goto fail5;
|
||||
goto fail4;
|
||||
|
||||
return 0;
|
||||
fail5:
|
||||
device_unregister(&imx_usb->gadget.dev);
|
||||
fail4:
|
||||
for (i = 0; i < IMX_USB_NB_EP + 1; i++)
|
||||
free_irq(imx_usb->usbd_int[i], imx_usb);
|
||||
@@ -1509,7 +1502,6 @@ static int __exit imx_udc_remove(struct platform_device *pdev)
|
||||
int i;
|
||||
|
||||
usb_del_gadget_udc(&imx_usb->gadget);
|
||||
device_unregister(&imx_usb->gadget.dev);
|
||||
imx_udc_disable(imx_usb);
|
||||
del_timer(&imx_usb->timer);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user