summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/bcm63xx_udc.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 15:09:06 +0100
committerFelipe Balbi <balbi@ti.com>2013-03-18 10:16:43 +0100
commit9b4ead05e7a3abf350d4ca1f7e0b71dc44f07f57 (patch)
tree2a69a022b73ba2b45a4062f4588fe787bbb824b2 /drivers/usb/gadget/bcm63xx_udc.c
parentusb: gadget: atmel_usba_udc: let udc-core manage gadget->dev (diff)
downloadlinux-9b4ead05e7a3abf350d4ca1f7e0b71dc44f07f57.tar.xz
linux-9b4ead05e7a3abf350d4ca1f7e0b71dc44f07f57.zip
usb: gadget: bcm63xx_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/bcm63xx_udc.c')
-rw-r--r--drivers/usb/gadget/bcm63xx_udc.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/usb/gadget/bcm63xx_udc.c b/drivers/usb/gadget/bcm63xx_udc.c
index 8cc8253f1100..c020b877219d 100644
--- a/drivers/usb/gadget/bcm63xx_udc.c
+++ b/drivers/usb/gadget/bcm63xx_udc.c
@@ -2368,13 +2368,13 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
spin_lock_init(&udc->lock);
INIT_WORK(&udc->ep0_wq, bcm63xx_ep0_process);
- dev_set_name(&udc->gadget.dev, "gadget");
udc->gadget.ops = &bcm63xx_udc_ops;
udc->gadget.name = dev_name(dev);
udc->gadget.dev.parent = dev;
udc->gadget.dev.release = bcm63xx_udc_gadget_release;
udc->gadget.dev.dma_mask = dev->dma_mask;
+ udc->gadget.register_my_device = true;
if (!pd->use_fullspeed && !use_fullspeed)
udc->gadget.max_speed = USB_SPEED_HIGH;
@@ -2414,17 +2414,12 @@ static int bcm63xx_udc_probe(struct platform_device *pdev)
}
}
- rc = device_register(&udc->gadget.dev);
- if (rc)
- goto out_uninit;
-
bcm63xx_udc_init_debugfs(udc);
rc = usb_add_gadget_udc(dev, &udc->gadget);
if (!rc)
return 0;
bcm63xx_udc_cleanup_debugfs(udc);
- device_unregister(&udc->gadget.dev);
out_uninit:
bcm63xx_uninit_udc_hw(udc);
return rc;
@@ -2440,7 +2435,6 @@ static int bcm63xx_udc_remove(struct platform_device *pdev)
bcm63xx_udc_cleanup_debugfs(udc);
usb_del_gadget_udc(&udc->gadget);
- device_unregister(&udc->gadget.dev);
BUG_ON(udc->driver);
platform_set_drvdata(pdev, NULL);