summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/pxa27x_udc.c
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 19:29:39 +0400
committerFelipe Balbi <balbi@ti.com>2013-03-18 13:16:54 +0400
commit45f596a6d776532f03135d48f10a1164006f9466 (patch)
treec2122eb938e4b16337fbd28eec86fad9df38db78 /drivers/usb/gadget/pxa27x_udc.c
parentb73f5a2a0a2b2ff10d941e35c2ff08fcc04a9862 (diff)
downloadlinux-45f596a6d776532f03135d48f10a1164006f9466.tar.xz
usb: gadget: pxa27x_udc: let udc-core manage gadget->dev
By simply setting a flag, we can drop some boilerplate code. Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/pxa27x_udc.c')
-rw-r--r--drivers/usb/gadget/pxa27x_udc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c
index 2fc867652ef5..1c5bfaafa6c8 100644
--- a/drivers/usb/gadget/pxa27x_udc.c
+++ b/drivers/usb/gadget/pxa27x_udc.c
@@ -1871,7 +1871,6 @@ static int pxa27x_udc_stop(struct usb_gadget *g,
udc->driver = NULL;
-
if (!IS_ERR_OR_NULL(udc->transceiver))
return otg_set_peripheral(udc->transceiver->otg, NULL);
return 0;
@@ -2456,9 +2455,9 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
goto err_map;
}
- device_initialize(&udc->gadget.dev);
udc->gadget.dev.parent = &pdev->dev;
udc->gadget.dev.dma_mask = NULL;
+ udc->gadget.register_my_device = true;
udc->vbus_sensed = 0;
the_controller = udc;
@@ -2475,12 +2474,6 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
goto err_irq;
}
- retval = device_add(&udc->gadget.dev);
- if (retval) {
- dev_err(udc->dev, "device_add error %d\n", retval);
- goto err_dev_add;
- }
-
retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget);
if (retval)
goto err_add_udc;
@@ -2490,8 +2483,6 @@ static int __init pxa_udc_probe(struct platform_device *pdev)
return 0;
err_add_udc:
- device_unregister(&udc->gadget.dev);
-err_dev_add:
free_irq(udc->irq, udc);
err_irq:
iounmap(udc->regs);
@@ -2512,7 +2503,6 @@ static int __exit pxa_udc_remove(struct platform_device *_dev)
int gpio = udc->mach->gpio_pullup;
usb_del_gadget_udc(&udc->gadget);
- device_del(&udc->gadget.dev);
usb_gadget_unregister_driver(udc->driver);
free_irq(udc->irq, udc);
pxa_cleanup_debugfs(udc);