aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/net2280.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/net2280.c')
-rw-r--r--drivers/usb/gadget/net2280.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c
index 3024c679e38e..569eb8ccf232 100644
--- a/drivers/usb/gadget/net2280.c
+++ b/drivers/usb/gadget/net2280.c
@@ -2020,7 +2020,6 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver)
2020 if (!driver 2020 if (!driver
2021 || driver->speed != USB_SPEED_HIGH 2021 || driver->speed != USB_SPEED_HIGH
2022 || !driver->bind 2022 || !driver->bind
2023 || !driver->unbind
2024 || !driver->setup) 2023 || !driver->setup)
2025 return -EINVAL; 2024 return -EINVAL;
2026 if (!dev) 2025 if (!dev)
@@ -2107,7 +2106,7 @@ int usb_gadget_unregister_driver (struct usb_gadget_driver *driver)
2107 2106
2108 if (!dev) 2107 if (!dev)
2109 return -ENODEV; 2108 return -ENODEV;
2110 if (!driver || driver != dev->driver) 2109 if (!driver || driver != dev->driver || !driver->unbind)
2111 return -EINVAL; 2110 return -EINVAL;
2112 2111
2113 spin_lock_irqsave (&dev->lock, flags); 2112 spin_lock_irqsave (&dev->lock, flags);
@@ -2803,13 +2802,7 @@ static void net2280_remove (struct pci_dev *pdev)
2803{ 2802{
2804 struct net2280 *dev = pci_get_drvdata (pdev); 2803 struct net2280 *dev = pci_get_drvdata (pdev);
2805 2804
2806 /* start with the driver above us */ 2805 BUG_ON(dev->driver);
2807 if (dev->driver) {
2808 /* should have been done already by driver model core */
2809 WARN (dev, "pci remove, driver '%s' is still registered\n",
2810 dev->driver->driver.name);
2811 usb_gadget_unregister_driver (dev->driver);
2812 }
2813 2806
2814 /* then clean up the resources we allocated during probe() */ 2807 /* then clean up the resources we allocated during probe() */
2815 net2280_led_shutdown (dev); 2808 net2280_led_shutdown (dev);