summaryrefslogtreecommitdiffstats
path: root/drivers/usb/musb
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 15:03:59 +0200
committerFelipe Balbi <balbi@ti.com>2013-03-18 11:16:40 +0200
commit5ed01c6400270dccb8c3574061ff3d163f0fe3fe (patch)
tree4e851deb5126b01b81ca03c919a507ca90f07b41 /drivers/usb/musb
parent1e1930bd3d9c6174eba1e3ca4135fd25ea3ad59c (diff)
downloadblackbird-op-linux-5ed01c6400270dccb8c3574061ff3d163f0fe3fe.tar.gz
blackbird-op-linux-5ed01c6400270dccb8c3574061ff3d163f0fe3fe.zip
usb: musb: gadget: let udc-core manage gadget-dev
By simply setting a flag, we can delete a little boilerplate code. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/musb')
-rw-r--r--drivers/usb/musb/musb_gadget.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index be18537c5f14..cadb750921e9 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -1887,12 +1887,11 @@ int musb_gadget_setup(struct musb *musb)
musb->g.speed = USB_SPEED_UNKNOWN;
/* this "gadget" abstracts/virtualizes the controller */
- dev_set_name(&musb->g.dev, "gadget");
musb->g.dev.parent = musb->controller;
musb->g.dev.dma_mask = musb->controller->dma_mask;
musb->g.dev.release = musb_gadget_release;
musb->g.name = musb_driver_name;
-
+ musb->g.register_my_device = true;
musb->g.is_otg = 1;
musb_g_init_endpoints(musb);
@@ -1900,11 +1899,6 @@ int musb_gadget_setup(struct musb *musb)
musb->is_active = 0;
musb_platform_try_idle(musb, 0);
- status = device_register(&musb->g.dev);
- if (status != 0) {
- put_device(&musb->g.dev);
- return status;
- }
status = usb_add_gadget_udc(musb->controller, &musb->g);
if (status)
goto err;
@@ -1919,8 +1913,6 @@ err:
void musb_gadget_cleanup(struct musb *musb)
{
usb_del_gadget_udc(&musb->g);
- if (musb->g.dev.parent)
- device_unregister(&musb->g.dev);
}
/*
OpenPOWER on IntegriCloud