diff options
Diffstat (limited to 'drivers/usb/gadget/r8a66597-udc.c')
-rw-r--r-- | drivers/usb/gadget/r8a66597-udc.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 6dcc1f68fa60..51b655f3b477 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
@@ -1410,7 +1410,7 @@ static struct usb_ep_ops r8a66597_ep_ops = { | |||
1410 | /*-------------------------------------------------------------------------*/ | 1410 | /*-------------------------------------------------------------------------*/ |
1411 | static struct r8a66597 *the_controller; | 1411 | static struct r8a66597 *the_controller; |
1412 | 1412 | ||
1413 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | 1413 | static int r8a66597_start(struct usb_gadget_driver *driver, |
1414 | int (*bind)(struct usb_gadget *)) | 1414 | int (*bind)(struct usb_gadget *)) |
1415 | { | 1415 | { |
1416 | struct r8a66597 *r8a66597 = the_controller; | 1416 | struct r8a66597 *r8a66597 = the_controller; |
@@ -1462,9 +1462,8 @@ error: | |||
1462 | 1462 | ||
1463 | return retval; | 1463 | return retval; |
1464 | } | 1464 | } |
1465 | EXPORT_SYMBOL(usb_gadget_probe_driver); | ||
1466 | 1465 | ||
1467 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 1466 | static int r8a66597_stop(struct usb_gadget_driver *driver) |
1468 | { | 1467 | { |
1469 | struct r8a66597 *r8a66597 = the_controller; | 1468 | struct r8a66597 *r8a66597 = the_controller; |
1470 | unsigned long flags; | 1469 | unsigned long flags; |
@@ -1488,7 +1487,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1488 | r8a66597->driver = NULL; | 1487 | r8a66597->driver = NULL; |
1489 | return 0; | 1488 | return 0; |
1490 | } | 1489 | } |
1491 | EXPORT_SYMBOL(usb_gadget_unregister_driver); | ||
1492 | 1490 | ||
1493 | /*-------------------------------------------------------------------------*/ | 1491 | /*-------------------------------------------------------------------------*/ |
1494 | static int r8a66597_get_frame(struct usb_gadget *_gadget) | 1492 | static int r8a66597_get_frame(struct usb_gadget *_gadget) |
@@ -1499,12 +1497,15 @@ static int r8a66597_get_frame(struct usb_gadget *_gadget) | |||
1499 | 1497 | ||
1500 | static struct usb_gadget_ops r8a66597_gadget_ops = { | 1498 | static struct usb_gadget_ops r8a66597_gadget_ops = { |
1501 | .get_frame = r8a66597_get_frame, | 1499 | .get_frame = r8a66597_get_frame, |
1500 | .start = r8a66597_start, | ||
1501 | .stop = r8a66597_stop, | ||
1502 | }; | 1502 | }; |
1503 | 1503 | ||
1504 | static int __exit r8a66597_remove(struct platform_device *pdev) | 1504 | static int __exit r8a66597_remove(struct platform_device *pdev) |
1505 | { | 1505 | { |
1506 | struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); | 1506 | struct r8a66597 *r8a66597 = dev_get_drvdata(&pdev->dev); |
1507 | 1507 | ||
1508 | usb_del_gadget_udc(&r8a66597->gadget); | ||
1508 | del_timer_sync(&r8a66597->timer); | 1509 | del_timer_sync(&r8a66597->timer); |
1509 | iounmap(r8a66597->reg); | 1510 | iounmap(r8a66597->reg); |
1510 | free_irq(platform_get_irq(pdev, 0), r8a66597); | 1511 | free_irq(platform_get_irq(pdev, 0), r8a66597); |
@@ -1647,9 +1648,15 @@ static int __init r8a66597_probe(struct platform_device *pdev) | |||
1647 | 1648 | ||
1648 | init_controller(r8a66597); | 1649 | init_controller(r8a66597); |
1649 | 1650 | ||
1651 | ret = usb_add_gadget_udc(&pdev->dev, &r8a66597->gadget); | ||
1652 | if (ret) | ||
1653 | goto err_add_udc; | ||
1654 | |||
1650 | dev_info(&pdev->dev, "version %s\n", DRIVER_VERSION); | 1655 | dev_info(&pdev->dev, "version %s\n", DRIVER_VERSION); |
1651 | return 0; | 1656 | return 0; |
1652 | 1657 | ||
1658 | err_add_udc: | ||
1659 | r8a66597_free_request(&r8a66597->ep[0].ep, r8a66597->ep0_req); | ||
1653 | clean_up3: | 1660 | clean_up3: |
1654 | free_irq(irq, r8a66597); | 1661 | free_irq(irq, r8a66597); |
1655 | clean_up2: | 1662 | clean_up2: |