aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/notify.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2019-06-25 16:03:58 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-26 10:28:09 +0800
commitffed60971f3d95923b99ea970862c6ab6a22c20f (patch)
tree295db5fee660d10d63a36be83f17f434bc0bc58c /drivers/usb/core/notify.c
parent58ee01007c9e00531c1280b2d99b49d29a5e9844 (diff)
downloadlinux-ffed60971f3d95923b99ea970862c6ab6a22c20f.tar.gz
USB: core: Remove usbfs_mutex
Commit 4a2a8a2cce86 ("usbfs: private mutex for open, release, and remove") is now obsolete. The commit was created back when we had to handle both usbfs device nodes and the old usbdevfs filesystem (/proc/bus/usb/), but usbdevfs no longer exists. This means there's no longer any need to hold a mutex during two separate removal operations (and thus during an entire notifier chain call). Furthermore, the one remaining remove/release pair doesn't race with open thanks to the synchronization provided by the device model core in bus_find_device(). Remove and release don't race with each other because they both run with the device lock held. The upshot is that usbfs_mutex isn't needed any more. This patch removes it entirely. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/notify.c')
-rw-r--r--drivers/usb/core/notify.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/usb/core/notify.c b/drivers/usb/core/notify.c
index ab474b11523ee8..e6143663778fbe 100644
--- a/drivers/usb/core/notify.c
+++ b/drivers/usb/core/notify.c
@@ -53,11 +53,8 @@ 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)