diff options
author | Felipe Balbi <balbi@ti.com> | 2013-01-24 10:29:39 -0500 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-03-18 05:16:54 -0400 |
commit | 45f596a6d776532f03135d48f10a1164006f9466 (patch) | |
tree | c2122eb938e4b16337fbd28eec86fad9df38db78 /drivers/usb/gadget/pxa27x_udc.c | |
parent | b73f5a2a0a2b2ff10d941e35c2ff08fcc04a9862 (diff) |
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.c | 12 |
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, | |||
1871 | 1871 | ||
1872 | udc->driver = NULL; | 1872 | udc->driver = NULL; |
1873 | 1873 | ||
1874 | |||
1875 | if (!IS_ERR_OR_NULL(udc->transceiver)) | 1874 | if (!IS_ERR_OR_NULL(udc->transceiver)) |
1876 | return otg_set_peripheral(udc->transceiver->otg, NULL); | 1875 | return otg_set_peripheral(udc->transceiver->otg, NULL); |
1877 | return 0; | 1876 | return 0; |
@@ -2456,9 +2455,9 @@ static int __init pxa_udc_probe(struct platform_device *pdev) | |||
2456 | goto err_map; | 2455 | goto err_map; |
2457 | } | 2456 | } |
2458 | 2457 | ||
2459 | device_initialize(&udc->gadget.dev); | ||
2460 | udc->gadget.dev.parent = &pdev->dev; | 2458 | udc->gadget.dev.parent = &pdev->dev; |
2461 | udc->gadget.dev.dma_mask = NULL; | 2459 | udc->gadget.dev.dma_mask = NULL; |
2460 | udc->gadget.register_my_device = true; | ||
2462 | udc->vbus_sensed = 0; | 2461 | udc->vbus_sensed = 0; |
2463 | 2462 | ||
2464 | the_controller = udc; | 2463 | the_controller = udc; |
@@ -2475,12 +2474,6 @@ static int __init pxa_udc_probe(struct platform_device *pdev) | |||
2475 | goto err_irq; | 2474 | goto err_irq; |
2476 | } | 2475 | } |
2477 | 2476 | ||
2478 | retval = device_add(&udc->gadget.dev); | ||
2479 | if (retval) { | ||
2480 | dev_err(udc->dev, "device_add error %d\n", retval); | ||
2481 | goto err_dev_add; | ||
2482 | } | ||
2483 | |||
2484 | retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget); | 2477 | retval = usb_add_gadget_udc(&pdev->dev, &udc->gadget); |
2485 | if (retval) | 2478 | if (retval) |
2486 | goto err_add_udc; | 2479 | goto err_add_udc; |
@@ -2490,8 +2483,6 @@ static int __init pxa_udc_probe(struct platform_device *pdev) | |||
2490 | return 0; | 2483 | return 0; |
2491 | 2484 | ||
2492 | err_add_udc: | 2485 | err_add_udc: |
2493 | device_unregister(&udc->gadget.dev); | ||
2494 | err_dev_add: | ||
2495 | free_irq(udc->irq, udc); | 2486 | free_irq(udc->irq, udc); |
2496 | err_irq: | 2487 | err_irq: |
2497 | iounmap(udc->regs); | 2488 | iounmap(udc->regs); |
@@ -2512,7 +2503,6 @@ static int __exit pxa_udc_remove(struct platform_device *_dev) | |||
2512 | int gpio = udc->mach->gpio_pullup; | 2503 | int gpio = udc->mach->gpio_pullup; |
2513 | 2504 | ||
2514 | usb_del_gadget_udc(&udc->gadget); | 2505 | usb_del_gadget_udc(&udc->gadget); |
2515 | device_del(&udc->gadget.dev); | ||
2516 | usb_gadget_unregister_driver(udc->driver); | 2506 | usb_gadget_unregister_driver(udc->driver); |
2517 | free_irq(udc->irq, udc); | 2507 | free_irq(udc->irq, udc); |
2518 | pxa_cleanup_debugfs(udc); | 2508 | pxa_cleanup_debugfs(udc); |