summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2013-01-24 15:21:36 +0200
committerFelipe Balbi <balbi@ti.com>2013-03-18 11:16:42 +0200
commit621c723eb71d2f02baafe20a3eaefc3a4dec7788 (patch)
tree8d1edf724190b17df08eb63696d111294a089466 /drivers
parent2533beea9025254215be65cd1fca8da65019fd04 (diff)
downloadtalos-obmc-linux-621c723eb71d2f02baafe20a3eaefc3a4dec7788.tar.gz
talos-obmc-linux-621c723eb71d2f02baafe20a3eaefc3a4dec7788.zip
usb: gadget: atmel_usba_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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/atmel_usba_udc.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c
index b66130c97269..2404d0c25668 100644
--- a/drivers/usb/gadget/atmel_usba_udc.c
+++ b/drivers/usb/gadget/atmel_usba_udc.c
@@ -1900,9 +1900,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "FIFO at 0x%08lx mapped at %p\n",
(unsigned long)fifo->start, udc->fifo);
- device_initialize(&udc->gadget.dev);
udc->gadget.dev.parent = &pdev->dev;
udc->gadget.dev.dma_mask = pdev->dev.dma_mask;
+ udc->gadget.register_my_device = true;
platform_set_drvdata(pdev, udc);
@@ -1962,12 +1962,6 @@ static int __init usba_udc_probe(struct platform_device *pdev)
}
udc->irq = irq;
- ret = device_add(&udc->gadget.dev);
- if (ret) {
- dev_dbg(&pdev->dev, "Could not add gadget: %d\n", ret);
- goto err_device_add;
- }
-
if (gpio_is_valid(pdata->vbus_pin)) {
if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) {
udc->vbus_pin = pdata->vbus_pin;
@@ -2007,9 +2001,6 @@ err_add_udc:
gpio_free(udc->vbus_pin);
}
- device_unregister(&udc->gadget.dev);
-
-err_device_add:
free_irq(irq, udc);
err_request_irq:
kfree(usba_ep);
@@ -2053,8 +2044,6 @@ static int __exit usba_udc_remove(struct platform_device *pdev)
clk_put(udc->hclk);
clk_put(udc->pclk);
- device_unregister(&udc->gadget.dev);
-
return 0;
}
OpenPOWER on IntegriCloud