summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 17:06:42 +0200
committerFelipe Balbi <balbi@ti.com>2013-03-18 11:16:52 +0200
commitb1e1eaba2916427d25fbd411cd863052836560ff (patch)
tree362e8fa1aa646e99acf5ce40fefac2fcc2bdefc8
parent40ed30cff5957d15dcd2638c6f48fae839a3100a (diff)
downloadop-kernel-dev-b1e1eaba2916427d25fbd411cd863052836560ff.zip
op-kernel-dev-b1e1eaba2916427d25fbd411cd863052836560ff.tar.gz
usb: gadget: s3c2410_udc: 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/s3c2410_udc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/usb/gadget/s3c2410_udc.c b/drivers/usb/gadget/s3c2410_udc.c
index 08f8965..c413494 100644
--- a/drivers/usb/gadget/s3c2410_udc.c
+++ b/drivers/usb/gadget/s3c2410_udc.c
@@ -1824,16 +1824,9 @@ static int s3c2410_udc_probe(struct platform_device *pdev)
goto err_mem;
}
- device_initialize(&udc->gadget.dev);
udc->gadget.dev.parent = &pdev->dev;
udc->gadget.dev.dma_mask = pdev->dev.dma_mask;
-
- /* 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;
- }
+ udc->gadget.register_my_device = true;
the_controller = udc;
platform_set_drvdata(pdev, udc);
@@ -1923,8 +1916,6 @@ err_gpio_claim:
err_int:
free_irq(IRQ_USBD, udc);
err_map:
- device_unregister(&udc->gadget.dev);
-err_device_add:
iounmap(base_addr);
err_mem:
release_mem_region(rsrc_start, rsrc_len);
@@ -1946,7 +1937,6 @@ static int s3c2410_udc_remove(struct platform_device *pdev)
return -EBUSY;
usb_del_gadget_udc(&udc->gadget);
- device_unregister(&udc->gadget.dev);
debugfs_remove(udc->regs_info);
if (udc_info && !udc_info->udc_command &&
OpenPOWER on IntegriCloud