summaryrefslogtreecommitdiff
path: root/drivers/usb/misc/legousbtower.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2019-11-05 11:41:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-11-07 13:17:50 +0300
commitb5a80252e09c2791380cdf10a6ebd7987900748c (patch)
treeb721deb1bda7adad2f7ddcd4199d7cd6a8adb145 /drivers/usb/misc/legousbtower.c
parent30da837a4938438a0259a7bc38dc05d66fa77c08 (diff)
downloadlinux-b5a80252e09c2791380cdf10a6ebd7987900748c.tar.xz
USB: legousbtower: drop redundant open_count check
Drop redundant open_count check in release; the open count is used as a flag and is only set to 0 or 1. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20191105084152.16322-5-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/misc/legousbtower.c')
-rw-r--r--drivers/usb/misc/legousbtower.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index c880d58e8683..1626a0d2b12b 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -421,13 +421,6 @@ static int tower_release (struct inode *inode, struct file *file)
mutex_lock(&dev->lock);
- if (dev->open_count != 1) {
- dev_dbg(&dev->udev->dev, "%s: device not opened exactly once\n",
- __func__);
- retval = -ENODEV;
- goto unlock_exit;
- }
-
if (dev->disconnected) {
/* the device was unplugged before the file was released */
@@ -444,7 +437,6 @@ static int tower_release (struct inode *inode, struct file *file)
tower_abort_transfers (dev);
dev->open_count = 0;
-unlock_exit:
mutex_unlock(&dev->lock);
exit:
return retval;