Commit b1e1eaba authored by Felipe Balbi's avatar Felipe Balbi

usb: gadget: s3c2410_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 40ed30cf
...@@ -1824,16 +1824,9 @@ static int s3c2410_udc_probe(struct platform_device *pdev) ...@@ -1824,16 +1824,9 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
goto err_mem; goto err_mem;
} }
device_initialize(&udc->gadget.dev);
udc->gadget.dev.parent = &pdev->dev; udc->gadget.dev.parent = &pdev->dev;
udc->gadget.dev.dma_mask = pdev->dev.dma_mask; udc->gadget.dev.dma_mask = pdev->dev.dma_mask;
udc->gadget.register_my_device = true;
/* Bind the driver */
retval = device_add(&udc->gadget.dev);
if (retval) {
dev_err(&udc->gadget.dev, "Error in device_add() : %d\n", retval);
goto err_device_add;
}
the_controller = udc; the_controller = udc;
platform_set_drvdata(pdev, udc); platform_set_drvdata(pdev, udc);
...@@ -1923,8 +1916,6 @@ static int s3c2410_udc_probe(struct platform_device *pdev) ...@@ -1923,8 +1916,6 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
err_int: err_int:
free_irq(IRQ_USBD, udc); free_irq(IRQ_USBD, udc);
err_map: err_map:
device_unregister(&udc->gadget.dev);
err_device_add:
iounmap(base_addr); iounmap(base_addr);
err_mem: err_mem:
release_mem_region(rsrc_start, rsrc_len); release_mem_region(rsrc_start, rsrc_len);
...@@ -1946,7 +1937,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev) ...@@ -1946,7 +1937,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev)
return -EBUSY; return -EBUSY;
usb_del_gadget_udc(&udc->gadget); usb_del_gadget_udc(&udc->gadget);
device_unregister(&udc->gadget.dev);
debugfs_remove(udc->regs_info); debugfs_remove(udc->regs_info);
if (udc_info && !udc_info->udc_command && if (udc_info && !udc_info->udc_command &&
......
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