summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 16:14:45 +0200
committerFelipe Balbi <balbi@ti.com>2013-03-18 11:16:45 +0200
commitfc84d2fbe776f5352c3a981a5250a3ad83789f72 (patch)
tree537e5f561eb647c4f79aa91d77a7d835af116d27 /drivers
parenteab35c4e6d952c91a413b408635ba6a9ec5fcf41 (diff)
usb: gadget: fusb300_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')
-rw-r--r--drivers/usb/gadget/fusb300_udc.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c
index 066cb89376de..d29017218b01 100644
--- a/drivers/usb/gadget/fusb300_udc.c
+++ b/drivers/usb/gadget/fusb300_udc.c
@@ -1422,15 +1422,12 @@ static int __init fusb300_probe(struct platform_device *pdev)
fusb300->gadget.ops = &fusb300_gadget_ops;
- device_initialize(&fusb300->gadget.dev);
-
- dev_set_name(&fusb300->gadget.dev, "gadget");
-
fusb300->gadget.max_speed = USB_SPEED_HIGH;
fusb300->gadget.dev.parent = &pdev->dev;
fusb300->gadget.dev.dma_mask = pdev->dev.dma_mask;
fusb300->gadget.dev.release = pdev->dev.release;
fusb300->gadget.name = udc_name;
+ fusb300->gadget.register_my_device = true;
fusb300->reg = reg;
ret = request_irq(ires->start, fusb300_irq, IRQF_SHARED,
@@ -1478,19 +1475,10 @@ static int __init fusb300_probe(struct platform_device *pdev)
if (ret)
goto err_add_udc;
- ret = device_add(&fusb300->gadget.dev);
- if (ret) {
- pr_err("device_add error (%d)\n", ret);
- goto err_add_device;
- }
-
dev_info(&pdev->dev, "version %s\n", DRIVER_VERSION);
return 0;
-err_add_device:
- usb_del_gadget_udc(&fusb300->gadget);
-
err_add_udc:
fusb300_free_request(&fusb300->ep[0]->ep, fusb300->ep0_req);