Commit 7a071890 authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarFelipe Balbi <balbi@ti.com>
parent 96d20c32
...@@ -1792,8 +1792,6 @@ static int mv_u3d_remove(struct platform_device *dev) ...@@ -1792,8 +1792,6 @@ static int mv_u3d_remove(struct platform_device *dev)
clk_put(u3d->clk); clk_put(u3d->clk);
device_unregister(&u3d->gadget.dev);
platform_set_drvdata(dev, NULL); platform_set_drvdata(dev, NULL);
kfree(u3d); kfree(u3d);
...@@ -1957,15 +1955,11 @@ static int mv_u3d_probe(struct platform_device *dev) ...@@ -1957,15 +1955,11 @@ static int mv_u3d_probe(struct platform_device *dev)
u3d->gadget.speed = USB_SPEED_UNKNOWN; /* speed */ u3d->gadget.speed = USB_SPEED_UNKNOWN; /* speed */
/* the "gadget" abstracts/virtualizes the controller */ /* the "gadget" abstracts/virtualizes the controller */
dev_set_name(&u3d->gadget.dev, "gadget");
u3d->gadget.dev.parent = &dev->dev; u3d->gadget.dev.parent = &dev->dev;
u3d->gadget.dev.dma_mask = dev->dev.dma_mask; u3d->gadget.dev.dma_mask = dev->dev.dma_mask;
u3d->gadget.dev.release = mv_u3d_gadget_release; u3d->gadget.dev.release = mv_u3d_gadget_release;
u3d->gadget.name = driver_name; /* gadget name */ u3d->gadget.name = driver_name; /* gadget name */
u3d->gadget.register_my_device = true;
retval = device_register(&u3d->gadget.dev);
if (retval)
goto err_register_gadget_device;
mv_u3d_eps_init(u3d); mv_u3d_eps_init(u3d);
...@@ -1991,8 +1985,6 @@ static int mv_u3d_probe(struct platform_device *dev) ...@@ -1991,8 +1985,6 @@ static int mv_u3d_probe(struct platform_device *dev)
return 0; return 0;
err_unregister: err_unregister:
device_unregister(&u3d->gadget.dev);
err_register_gadget_device:
free_irq(u3d->irq, &dev->dev); free_irq(u3d->irq, &dev->dev);
err_request_irq: err_request_irq:
err_get_irq: err_get_irq:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment