diff options
author | Felipe Balbi | 2013-01-24 16:37:24 +0200 |
---|---|---|
committer | Felipe Balbi | 2013-03-18 11:16:47 +0200 |
commit | 7a071890b467e3b820b6afb13f2a877a249ae8f9 (patch) | |
tree | 6bbff84a07ba4d7734665c750b7e03eb76ad777c | |
parent | 96d20c32f68b058b4430a6f711124511a2d9b361 (diff) |
usb: gadget: mv_u3d_core: 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>
-rw-r--r-- | drivers/usb/gadget/mv_u3d_core.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c index b5cea273c957..565addcd3956 100644 --- a/drivers/usb/gadget/mv_u3d_core.c +++ b/drivers/usb/gadget/mv_u3d_core.c @@ -1792,8 +1792,6 @@ static int mv_u3d_remove(struct platform_device *dev) clk_put(u3d->clk); - device_unregister(&u3d->gadget.dev); - platform_set_drvdata(dev, NULL); kfree(u3d); @@ -1957,15 +1955,11 @@ static int mv_u3d_probe(struct platform_device *dev) u3d->gadget.speed = USB_SPEED_UNKNOWN; /* speed */ /* the "gadget" abstracts/virtualizes the controller */ - dev_set_name(&u3d->gadget.dev, "gadget"); u3d->gadget.dev.parent = &dev->dev; u3d->gadget.dev.dma_mask = dev->dev.dma_mask; u3d->gadget.dev.release = mv_u3d_gadget_release; u3d->gadget.name = driver_name; /* gadget name */ - - retval = device_register(&u3d->gadget.dev); - if (retval) - goto err_register_gadget_device; + u3d->gadget.register_my_device = true; mv_u3d_eps_init(u3d); @@ -1991,8 +1985,6 @@ static int mv_u3d_probe(struct platform_device *dev) return 0; err_unregister: - device_unregister(&u3d->gadget.dev); -err_register_gadget_device: free_irq(u3d->irq, &dev->dev); err_request_irq: err_get_irq: |