diff options
author | Felipe Balbi <balbi@ti.com> | 2013-01-24 08:21:36 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:16:42 -0400 |
commit | 621c723eb71d2f02baafe20a3eaefc3a4dec7788 (patch) | |
tree | 8d1edf724190b17df08eb63696d111294a089466 /drivers/usb/gadget/atmel_usba_udc.c | |
parent | 2533beea9025254215be65cd1fca8da65019fd04 (diff) |
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/usb/gadget/atmel_usba_udc.c')
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 13 |
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) | |||
1900 | dev_info(&pdev->dev, "FIFO at 0x%08lx mapped at %p\n", | 1900 | dev_info(&pdev->dev, "FIFO at 0x%08lx mapped at %p\n", |
1901 | (unsigned long)fifo->start, udc->fifo); | 1901 | (unsigned long)fifo->start, udc->fifo); |
1902 | 1902 | ||
1903 | device_initialize(&udc->gadget.dev); | ||
1904 | udc->gadget.dev.parent = &pdev->dev; | 1903 | udc->gadget.dev.parent = &pdev->dev; |
1905 | udc->gadget.dev.dma_mask = pdev->dev.dma_mask; | 1904 | udc->gadget.dev.dma_mask = pdev->dev.dma_mask; |
1905 | udc->gadget.register_my_device = true; | ||
1906 | 1906 | ||
1907 | platform_set_drvdata(pdev, udc); | 1907 | platform_set_drvdata(pdev, udc); |
1908 | 1908 | ||
@@ -1962,12 +1962,6 @@ static int __init usba_udc_probe(struct platform_device *pdev) | |||
1962 | } | 1962 | } |
1963 | udc->irq = irq; | 1963 | udc->irq = irq; |
1964 | 1964 | ||
1965 | ret = device_add(&udc->gadget.dev); | ||
1966 | if (ret) { | ||
1967 | dev_dbg(&pdev->dev, "Could not add gadget: %d\n", ret); | ||
1968 | goto err_device_add; | ||
1969 | } | ||
1970 | |||
1971 | if (gpio_is_valid(pdata->vbus_pin)) { | 1965 | if (gpio_is_valid(pdata->vbus_pin)) { |
1972 | if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { | 1966 | if (!gpio_request(pdata->vbus_pin, "atmel_usba_udc")) { |
1973 | udc->vbus_pin = pdata->vbus_pin; | 1967 | udc->vbus_pin = pdata->vbus_pin; |
@@ -2007,9 +2001,6 @@ err_add_udc: | |||
2007 | gpio_free(udc->vbus_pin); | 2001 | gpio_free(udc->vbus_pin); |
2008 | } | 2002 | } |
2009 | 2003 | ||
2010 | device_unregister(&udc->gadget.dev); | ||
2011 | |||
2012 | err_device_add: | ||
2013 | free_irq(irq, udc); | 2004 | free_irq(irq, udc); |
2014 | err_request_irq: | 2005 | err_request_irq: |
2015 | kfree(usba_ep); | 2006 | kfree(usba_ep); |
@@ -2053,8 +2044,6 @@ static int __exit usba_udc_remove(struct platform_device *pdev) | |||
2053 | clk_put(udc->hclk); | 2044 | clk_put(udc->hclk); |
2054 | clk_put(udc->pclk); | 2045 | clk_put(udc->pclk); |
2055 | 2046 | ||
2056 | device_unregister(&udc->gadget.dev); | ||
2057 | |||
2058 | return 0; | 2047 | return 0; |
2059 | } | 2048 | } |
2060 | 2049 | ||