Commit 12ad0fca authored by Felipe Balbi's avatar Felipe Balbi

usb: gadget: amd5536udc: let udc-core manage gadget->dev

By simply setting a flag, we drop some boilerplate
code.
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent 6dfc84fc
...@@ -3080,7 +3080,6 @@ static void udc_pci_remove(struct pci_dev *pdev) ...@@ -3080,7 +3080,6 @@ static void udc_pci_remove(struct pci_dev *pdev)
if (dev->active) if (dev->active)
pci_disable_device(pdev); pci_disable_device(pdev);
device_unregister(&dev->gadget.dev);
pci_set_drvdata(pdev, NULL); pci_set_drvdata(pdev, NULL);
udc_remove(dev); udc_remove(dev);
...@@ -3276,6 +3275,7 @@ static int udc_probe(struct udc *dev) ...@@ -3276,6 +3275,7 @@ static int udc_probe(struct udc *dev)
dev->gadget.dev.release = gadget_release; dev->gadget.dev.release = gadget_release;
dev->gadget.name = name; dev->gadget.name = name;
dev->gadget.max_speed = USB_SPEED_HIGH; dev->gadget.max_speed = USB_SPEED_HIGH;
dev->gadget.register_my_device = true;
/* init registers, interrupts, ... */ /* init registers, interrupts, ... */
startup_registers(dev); startup_registers(dev);
...@@ -3301,13 +3301,6 @@ static int udc_probe(struct udc *dev) ...@@ -3301,13 +3301,6 @@ static int udc_probe(struct udc *dev)
if (retval) if (retval)
goto finished; goto finished;
retval = device_register(&dev->gadget.dev);
if (retval) {
usb_del_gadget_udc(&dev->gadget);
put_device(&dev->gadget.dev);
goto finished;
}
/* timer init */ /* timer init */
init_timer(&udc_timer); init_timer(&udc_timer);
udc_timer.function = udc_timer_function; udc_timer.function = udc_timer_function;
......
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