summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/imx_udc.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 16:22:57 +0200
committerFelipe Balbi <balbi@ti.com>2013-03-18 11:16:46 +0200
commit0b3702c62e41f3707cb8ba68bf46561597a6f0af (patch)
tree284fa5319d63734d8e6fefeebecc23b97baeed6e /drivers/usb/gadget/imx_udc.c
parent5637bf5b7a91804fe0230dff70024df078786090 (diff)
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>
Diffstat (limited to 'drivers/usb/gadget/imx_udc.c')
-rw-r--r--drivers/usb/gadget/imx_udc.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c
index 5bd930d779b..435b20346ea 100644
--- a/drivers/usb/gadget/imx_udc.c
+++ b/drivers/usb/gadget/imx_udc.c
@@ -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);