提交 b5a80252 编写于 作者: J Johan Hovold 提交者: Greg Kroah-Hartman

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: NJohan Hovold <johan@kernel.org>
Link: https://lore.kernel.org/r/20191105084152.16322-5-johan@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 30da837a
...@@ -421,13 +421,6 @@ static int tower_release (struct inode *inode, struct file *file) ...@@ -421,13 +421,6 @@ static int tower_release (struct inode *inode, struct file *file)
mutex_lock(&dev->lock); 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) { if (dev->disconnected) {
/* the device was unplugged before the file was released */ /* the device was unplugged before the file was released */
...@@ -444,7 +437,6 @@ static int tower_release (struct inode *inode, struct file *file) ...@@ -444,7 +437,6 @@ static int tower_release (struct inode *inode, struct file *file)
tower_abort_transfers (dev); tower_abort_transfers (dev);
dev->open_count = 0; dev->open_count = 0;
unlock_exit:
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
exit: exit:
return retval; return retval;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册