aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/amd5536udc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/amd5536udc.c')
-rw-r--r--drivers/usb/gadget/amd5536udc.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 95e8138cd48f..70f2b376c86d 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -1438,10 +1438,15 @@ static int udc_wakeup(struct usb_gadget *gadget)
1438 return 0; 1438 return 0;
1439} 1439}
1440 1440
1441static int amd5536_start(struct usb_gadget_driver *driver,
1442 int (*bind)(struct usb_gadget *));
1443static int amd5536_stop(struct usb_gadget_driver *driver);
1441/* gadget operations */ 1444/* gadget operations */
1442static const struct usb_gadget_ops udc_ops = { 1445static const struct usb_gadget_ops udc_ops = {
1443 .wakeup = udc_wakeup, 1446 .wakeup = udc_wakeup,
1444 .get_frame = udc_get_frame, 1447 .get_frame = udc_get_frame,
1448 .start = amd5536_start,
1449 .stop = amd5536_stop,
1445}; 1450};
1446 1451
1447/* Setups endpoint parameters, adds endpoints to linked list */ 1452/* Setups endpoint parameters, adds endpoints to linked list */
@@ -1955,7 +1960,7 @@ static int setup_ep0(struct udc *dev)
1955} 1960}
1956 1961
1957/* Called by gadget driver to register itself */ 1962/* Called by gadget driver to register itself */
1958int usb_gadget_probe_driver(struct usb_gadget_driver *driver, 1963static int amd5536_start(struct usb_gadget_driver *driver,
1959 int (*bind)(struct usb_gadget *)) 1964 int (*bind)(struct usb_gadget *))
1960{ 1965{
1961 struct udc *dev = udc; 1966 struct udc *dev = udc;
@@ -2002,7 +2007,6 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
2002 2007
2003 return 0; 2008 return 0;
2004} 2009}
2005EXPORT_SYMBOL(usb_gadget_probe_driver);
2006 2010
2007/* shutdown requests and disconnect from gadget */ 2011/* shutdown requests and disconnect from gadget */
2008static void 2012static void
@@ -2027,7 +2031,7 @@ __acquires(dev->lock)
2027} 2031}
2028 2032
2029/* Called by gadget driver to unregister itself */ 2033/* Called by gadget driver to unregister itself */
2030int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) 2034static int amd5536_stop(struct usb_gadget_driver *driver)
2031{ 2035{
2032 struct udc *dev = udc; 2036 struct udc *dev = udc;
2033 unsigned long flags; 2037 unsigned long flags;
@@ -2057,8 +2061,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
2057 2061
2058 return 0; 2062 return 0;
2059} 2063}
2060EXPORT_SYMBOL(usb_gadget_unregister_driver);
2061
2062 2064
2063/* Clear pending NAK bits */ 2065/* Clear pending NAK bits */
2064static void udc_process_cnak_queue(struct udc *dev) 2066static void udc_process_cnak_queue(struct udc *dev)
@@ -3134,6 +3136,7 @@ static void udc_pci_remove(struct pci_dev *pdev)
3134 3136
3135 dev = pci_get_drvdata(pdev); 3137 dev = pci_get_drvdata(pdev);
3136 3138
3139 usb_del_gadget_udc(&udc->gadget);
3137 /* gadget driver must not be registered */ 3140 /* gadget driver must not be registered */
3138 BUG_ON(dev->driver != NULL); 3141 BUG_ON(dev->driver != NULL);
3139 3142
@@ -3382,8 +3385,13 @@ static int udc_probe(struct udc *dev)
3382 "driver version: %s(for Geode5536 B1)\n", tmp); 3385 "driver version: %s(for Geode5536 B1)\n", tmp);
3383 udc = dev; 3386 udc = dev;
3384 3387
3388 retval = usb_add_gadget_udc(&udc->pdev->dev, &dev->gadget);
3389 if (retval)
3390 goto finished;
3391
3385 retval = device_register(&dev->gadget.dev); 3392 retval = device_register(&dev->gadget.dev);
3386 if (retval) { 3393 if (retval) {
3394 usb_del_gadget_udc(&dev->gadget);
3387 put_device(&dev->gadget.dev); 3395 put_device(&dev->gadget.dev);
3388 goto finished; 3396 goto finished;
3389 } 3397 }