提交 d69f2718 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

V4L/DVB: v4l2-dev: after a disconnect any ioctl call will be blocked

Until now all fops except release and (unlocked_)ioctl returned an error
after the device node was unregistered. Extend this as well to the ioctl
fops. There is nothing useful that an application can do here and it
complicates the driver code unnecessarily.
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 96322b80
......@@ -551,9 +551,8 @@ from /dev).
After video_unregister_device() returns no new opens can be done. However,
in the case of USB devices some application might still have one of these
device nodes open. So after the unregister all file operations will return
an error as well, except for the ioctl and unlocked_ioctl file operations:
those will still be passed on since some buffer ioctls may still be needed.
device nodes open. So after the unregister all file operations (except
release, of course) will return an error as well.
When the last user of the video device node exits, then the vdev->release()
callback is called and you can do the final cleanup there.
......
......@@ -221,8 +221,8 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
struct video_device *vdev = video_devdata(filp);
int ret;
/* Allow ioctl to continue even if the device was unregistered.
Things like dequeueing buffers might still be useful. */
if (!vdev->fops->ioctl)
return -ENOTTY;
if (vdev->fops->unlocked_ioctl) {
ret = vdev->fops->unlocked_ioctl(filp, cmd, arg);
} else if (vdev->fops->ioctl) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册