summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 14:35:12 (GMT)
committerFelipe Balbi <balbi@ti.com>2013-03-18 09:16:47 (GMT)
commit96d20c32f68b058b4430a6f711124511a2d9b361 (patch)
treed4d22483971b11b0e2f1cd28a656ffe96a41f728 /drivers/usb
parente0c9e4739a6f9217f35f1a59807a2f19a4cd7cdd (diff)
downloadlinux-fsl-qoriq-96d20c32f68b058b4430a6f711124511a2d9b361.tar.xz
usb: gadget: m66592-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')
-rw-r--r--drivers/usb/gadget/m66592-udc.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c
index c1b8c2d..43ad70d 100644
--- a/drivers/usb/gadget/m66592-udc.c
+++ b/drivers/usb/gadget/m66592-udc.c
@@ -1538,7 +1538,6 @@ static int __exit m66592_remove(struct platform_device *pdev)
struct m66592 *m66592 = dev_get_drvdata(&pdev->dev);
usb_del_gadget_udc(&m66592->gadget);
- device_del(&m66592->gadget.dev);
del_timer_sync(&m66592->timer);
iounmap(m66592->reg);
@@ -1608,13 +1607,12 @@ static int __init m66592_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, m66592);
m66592->gadget.ops = &m66592_gadget_ops;
- device_initialize(&m66592->gadget.dev);
- dev_set_name(&m66592->gadget.dev, "gadget");
m66592->gadget.max_speed = USB_SPEED_HIGH;
m66592->gadget.dev.parent = &pdev->dev;
m66592->gadget.dev.dma_mask = pdev->dev.dma_mask;
m66592->gadget.dev.release = pdev->dev.release;
m66592->gadget.name = udc_name;
+ m66592->gadget.register_my_device = true;
init_timer(&m66592->timer);
m66592->timer.function = m66592_timer;
@@ -1674,12 +1672,6 @@ static int __init m66592_probe(struct platform_device *pdev)
init_controller(m66592);
- ret = device_add(&m66592->gadget.dev);
- if (ret) {
- pr_err("device_add error (%d)\n", ret);
- goto err_device_add;
- }
-
ret = usb_add_gadget_udc(&pdev->dev, &m66592->gadget);
if (ret)
goto err_add_udc;
@@ -1688,9 +1680,6 @@ static int __init m66592_probe(struct platform_device *pdev)
return 0;
err_add_udc:
- device_del(&m66592->gadget.dev);
-
-err_device_add:
m66592_free_request(&m66592->ep[0].ep, m66592->ep0_req);
clean_up3: