diff options
Diffstat (limited to 'drivers/usb/gadget/goku_udc.c')
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index bf6e11c758d5..7f87805cddc4 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -996,8 +996,14 @@ static int goku_get_frame(struct usb_gadget *_gadget) | |||
996 | return -EOPNOTSUPP; | 996 | return -EOPNOTSUPP; |
997 | } | 997 | } |
998 | 998 | ||
999 | static int goku_start(struct usb_gadget_driver *driver, | ||
1000 | int (*bind)(struct usb_gadget *)); | ||
1001 | static int goku_stop(struct usb_gadget_driver *driver); | ||
1002 | |||
999 | static const struct usb_gadget_ops goku_ops = { | 1003 | static const struct usb_gadget_ops goku_ops = { |
1000 | .get_frame = goku_get_frame, | 1004 | .get_frame = goku_get_frame, |
1005 | .start = goku_start, | ||
1006 | .stop = goku_stop, | ||
1001 | // no remote wakeup | 1007 | // no remote wakeup |
1002 | // not selfpowered | 1008 | // not selfpowered |
1003 | }; | 1009 | }; |
@@ -1344,7 +1350,7 @@ static struct goku_udc *the_controller; | |||
1344 | * disconnect is reported. then a host may connect again, or | 1350 | * disconnect is reported. then a host may connect again, or |
1345 | * the driver might get unbound. | 1351 | * the driver might get unbound. |
1346 | */ | 1352 | */ |
1347 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | 1353 | static int goku_start(struct usb_gadget_driver *driver, |
1348 | int (*bind)(struct usb_gadget *)) | 1354 | int (*bind)(struct usb_gadget *)) |
1349 | { | 1355 | { |
1350 | struct goku_udc *dev = the_controller; | 1356 | struct goku_udc *dev = the_controller; |
@@ -1382,7 +1388,6 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
1382 | DBG(dev, "registered gadget driver '%s'\n", driver->driver.name); | 1388 | DBG(dev, "registered gadget driver '%s'\n", driver->driver.name); |
1383 | return 0; | 1389 | return 0; |
1384 | } | 1390 | } |
1385 | EXPORT_SYMBOL(usb_gadget_probe_driver); | ||
1386 | 1391 | ||
1387 | static void | 1392 | static void |
1388 | stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver) | 1393 | stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver) |
@@ -1408,7 +1413,7 @@ stop_activity(struct goku_udc *dev, struct usb_gadget_driver *driver) | |||
1408 | udc_enable(dev); | 1413 | udc_enable(dev); |
1409 | } | 1414 | } |
1410 | 1415 | ||
1411 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 1416 | static int goku_stop(struct usb_gadget_driver *driver) |
1412 | { | 1417 | { |
1413 | struct goku_udc *dev = the_controller; | 1418 | struct goku_udc *dev = the_controller; |
1414 | unsigned long flags; | 1419 | unsigned long flags; |
@@ -1429,8 +1434,6 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | |||
1429 | DBG(dev, "unregistered driver '%s'\n", driver->driver.name); | 1434 | DBG(dev, "unregistered driver '%s'\n", driver->driver.name); |
1430 | return 0; | 1435 | return 0; |
1431 | } | 1436 | } |
1432 | EXPORT_SYMBOL(usb_gadget_unregister_driver); | ||
1433 | |||
1434 | 1437 | ||
1435 | /*-------------------------------------------------------------------------*/ | 1438 | /*-------------------------------------------------------------------------*/ |
1436 | 1439 | ||
@@ -1730,6 +1733,8 @@ static void goku_remove(struct pci_dev *pdev) | |||
1730 | 1733 | ||
1731 | DBG(dev, "%s\n", __func__); | 1734 | DBG(dev, "%s\n", __func__); |
1732 | 1735 | ||
1736 | usb_del_gadget_udc(&dev->gadget); | ||
1737 | |||
1733 | BUG_ON(dev->driver); | 1738 | BUG_ON(dev->driver); |
1734 | 1739 | ||
1735 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES | 1740 | #ifdef CONFIG_USB_GADGET_DEBUG_FILES |
@@ -1854,6 +1859,10 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1854 | goto err; | 1859 | goto err; |
1855 | } | 1860 | } |
1856 | dev->registered = 1; | 1861 | dev->registered = 1; |
1862 | retval = usb_add_gadget_udc(&pdev->dev, &dev->gadget); | ||
1863 | if (retval) | ||
1864 | goto err; | ||
1865 | |||
1857 | return 0; | 1866 | return 0; |
1858 | 1867 | ||
1859 | err: | 1868 | err: |