]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/core/notify.c
usb: gadget Kconfig cleanup
[linux-2.6-omap-h63xx.git] / drivers / usb / core / notify.c
index fe0ed54fa0ae1b982c8ea1e94d15dfdf8d568bb5..7542dce3f5a1e2b01bcbd2ef78c08bd870c31b1a 100644 (file)
@@ -9,7 +9,6 @@
  */
 
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/notifier.h>
 #include <linux/usb.h>
@@ -34,7 +33,7 @@ EXPORT_SYMBOL_GPL(usb_register_notify);
  * usb_unregister_notify - unregister a notifier callback
  * @nb: pointer to the notifier block for the callback events.
  *
- * usb_register_notifier() must have been previously called for this function
+ * usb_register_notify() must have been previously called for this function
  * to work properly.
  */
 void usb_unregister_notify(struct notifier_block *nb)
@@ -51,8 +50,11 @@ void usb_notify_add_device(struct usb_device *udev)
 
 void usb_notify_remove_device(struct usb_device *udev)
 {
+       /* Protect against simultaneous usbfs open */
+       mutex_lock(&usbfs_mutex);
        blocking_notifier_call_chain(&usb_notifier_list,
                        USB_DEVICE_REMOVE, udev);
+       mutex_unlock(&usbfs_mutex);
 }
 
 void usb_notify_add_bus(struct usb_bus *ubus)