Commit b73f5a2a authored by Felipe Balbi's avatar Felipe Balbi

usb: gadget: pxa25x_udc: 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 0972ef71
...@@ -2138,16 +2138,9 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) ...@@ -2138,16 +2138,9 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
dev->timer.function = udc_watchdog; dev->timer.function = udc_watchdog;
dev->timer.data = (unsigned long) dev; dev->timer.data = (unsigned long) dev;
device_initialize(&dev->gadget.dev);
dev->gadget.dev.parent = &pdev->dev; dev->gadget.dev.parent = &pdev->dev;
dev->gadget.dev.dma_mask = pdev->dev.dma_mask; dev->gadget.dev.dma_mask = pdev->dev.dma_mask;
dev->gadget.register_my_device = true;
retval = device_add(&dev->gadget.dev);
if (retval) {
dev->driver = NULL;
dev->gadget.dev.driver = NULL;
goto err_device_add;
}
the_controller = dev; the_controller = dev;
platform_set_drvdata(pdev, dev); platform_set_drvdata(pdev, dev);
...@@ -2199,8 +2192,6 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) ...@@ -2199,8 +2192,6 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
free_irq(irq, dev); free_irq(irq, dev);
#endif #endif
err_irq1: err_irq1:
device_unregister(&dev->gadget.dev);
err_device_add:
if (gpio_is_valid(dev->mach->gpio_pullup)) if (gpio_is_valid(dev->mach->gpio_pullup))
gpio_free(dev->mach->gpio_pullup); gpio_free(dev->mach->gpio_pullup);
err_gpio_pullup: err_gpio_pullup:
...@@ -2226,7 +2217,6 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev) ...@@ -2226,7 +2217,6 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
return -EBUSY; return -EBUSY;
usb_del_gadget_udc(&dev->gadget); usb_del_gadget_udc(&dev->gadget);
device_unregister(&dev->gadget.dev);
dev->pullup = 0; dev->pullup = 0;
pullup(dev); pullup(dev);
......
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