aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/lh7a40x_udc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-12-21 03:01:06 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-21 03:01:06 -0500
commitfb34d203d0b5ac1b8284973eb0db3fdff101fc5e (patch)
treed882cb10f1bb69f0058881df5dad6bd433cd28e5 /drivers/usb/gadget/lh7a40x_udc.c
parent5576d187a0eef3bb3c47500eaab33fb5485bc352 (diff)
parentc3052905033f8785bcb2c71d5ce40b84259e3a80 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (34 commits) USB Storage: remove duplicate Nokia entry in unusual_devs.h [PATCH] bluetooth: add support for another Kensington dongle [PATCH] usb serial: add support for Novatel S720/U720 CDMA/EV-DO modems [PATCH] USB: Nokia E70 is an unusual device USB: fix to usbfs_snoop logging of user defined control urbs USB: at91_udc: Additional checks USB: at91_udc: Cleanup variables after failure in usb_gadget_register_driver() USB: at91_udc: allow drivers that support high speed USB: u132-hcd/ftdi-elan: add support for Option GT 3G Quad card USB: at91_udc, misc fixes USB: at91 udc, support at91sam926x addresses USB: OHCI support for PNX8550 USB: ohci handles hardware faults during root port resets USB: ohci at91 warning fix USB: ohci whitespace/comment fixups USB: MAINTAINERS update, EHCI and OHCI USB: gadget driver unbind() is optional; section fixes; misc UHCI: module parameter to ignore overcurrent changes USB: Nokia E70 is an unusual device USB AUERSWALD: replace kmalloc+memset with kzalloc ...
Diffstat (limited to 'drivers/usb/gadget/lh7a40x_udc.c')
-rw-r--r--drivers/usb/gadget/lh7a40x_udc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c
index 4a991564a03e..a0a73c08a344 100644
--- a/drivers/usb/gadget/lh7a40x_udc.c
+++ b/drivers/usb/gadget/lh7a40x_udc.c
@@ -422,9 +422,10 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver)
422 DEBUG("%s: %s\n", __FUNCTION__, driver->driver.name); 422 DEBUG("%s: %s\n", __FUNCTION__, driver->driver.name);
423 423
424 if (!driver 424 if (!driver
425 || driver->speed != USB_SPEED_FULL 425 || driver->speed != USB_SPEED_FULL
426 || !driver->bind 426 || !driver->bind
427 || !driver->unbind || !driver->disconnect || !driver->setup) 427 || !driver->disconnect
428 || !driver->setup)
428 return -EINVAL; 429 return -EINVAL;
429 if (!dev) 430 if (!dev)
430 return -ENODEV; 431 return -ENODEV;
@@ -471,7 +472,7 @@ int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
471 472
472 if (!dev) 473 if (!dev)
473 return -ENODEV; 474 return -ENODEV;
474 if (!driver || driver != dev->driver) 475 if (!driver || driver != dev->driver || !driver->unbind)
475 return -EINVAL; 476 return -EINVAL;
476 477
477 spin_lock_irqsave(&dev->lock, flags); 478 spin_lock_irqsave(&dev->lock, flags);
@@ -2125,9 +2126,11 @@ static int lh7a40x_udc_remove(struct platform_device *pdev)
2125 2126
2126 DEBUG("%s: %p\n", __FUNCTION__, pdev); 2127 DEBUG("%s: %p\n", __FUNCTION__, pdev);
2127 2128
2129 if (dev->driver)
2130 return -EBUSY;
2131
2128 udc_disable(dev); 2132 udc_disable(dev);
2129 remove_proc_files(); 2133 remove_proc_files();
2130 usb_gadget_unregister_driver(dev->driver);
2131 2134
2132 free_irq(IRQ_USBINTR, dev); 2135 free_irq(IRQ_USBINTR, dev);
2133 2136