USB: iowarrior: drop redundant iowarrior mutex
Drop the redundant iowarrior mutex introduced by commit 925ce689bb
("USB: autoconvert trivial BKL users to private mutex") which replaced
an earlier BKL use.
The lock serialised calls to open() against other open() and ioctl(),
but neither is needed.
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191009104846.5925-6-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
7c5b971d62
commit
8d33e828f7
@@ -54,9 +54,6 @@ MODULE_AUTHOR(DRIVER_AUTHOR);
|
|||||||
MODULE_DESCRIPTION(DRIVER_DESC);
|
MODULE_DESCRIPTION(DRIVER_DESC);
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
/* Module parameters */
|
|
||||||
static DEFINE_MUTEX(iowarrior_mutex);
|
|
||||||
|
|
||||||
static struct usb_driver iowarrior_driver;
|
static struct usb_driver iowarrior_driver;
|
||||||
|
|
||||||
/*--------------*/
|
/*--------------*/
|
||||||
@@ -480,8 +477,6 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd,
|
|||||||
if (!buffer)
|
if (!buffer)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
/* lock this object */
|
|
||||||
mutex_lock(&iowarrior_mutex);
|
|
||||||
mutex_lock(&dev->mutex);
|
mutex_lock(&dev->mutex);
|
||||||
|
|
||||||
/* verify that the device wasn't unplugged */
|
/* verify that the device wasn't unplugged */
|
||||||
@@ -574,7 +569,6 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd,
|
|||||||
error_out:
|
error_out:
|
||||||
/* unlock the device */
|
/* unlock the device */
|
||||||
mutex_unlock(&dev->mutex);
|
mutex_unlock(&dev->mutex);
|
||||||
mutex_unlock(&iowarrior_mutex);
|
|
||||||
kfree(buffer);
|
kfree(buffer);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@@ -589,22 +583,18 @@ static int iowarrior_open(struct inode *inode, struct file *file)
|
|||||||
int subminor;
|
int subminor;
|
||||||
int retval = 0;
|
int retval = 0;
|
||||||
|
|
||||||
mutex_lock(&iowarrior_mutex);
|
|
||||||
subminor = iminor(inode);
|
subminor = iminor(inode);
|
||||||
|
|
||||||
interface = usb_find_interface(&iowarrior_driver, subminor);
|
interface = usb_find_interface(&iowarrior_driver, subminor);
|
||||||
if (!interface) {
|
if (!interface) {
|
||||||
mutex_unlock(&iowarrior_mutex);
|
|
||||||
printk(KERN_ERR "%s - error, can't find device for minor %d\n",
|
printk(KERN_ERR "%s - error, can't find device for minor %d\n",
|
||||||
__func__, subminor);
|
__func__, subminor);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
dev = usb_get_intfdata(interface);
|
dev = usb_get_intfdata(interface);
|
||||||
if (!dev) {
|
if (!dev)
|
||||||
mutex_unlock(&iowarrior_mutex);
|
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
|
||||||
|
|
||||||
mutex_lock(&dev->mutex);
|
mutex_lock(&dev->mutex);
|
||||||
|
|
||||||
@@ -628,7 +618,6 @@ static int iowarrior_open(struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
out:
|
out:
|
||||||
mutex_unlock(&dev->mutex);
|
mutex_unlock(&dev->mutex);
|
||||||
mutex_unlock(&iowarrior_mutex);
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user