diff options
-rw-r--r-- | Documentation/video4linux/v4l2-framework.txt | 5 | ||||
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/Documentation/video4linux/v4l2-framework.txt b/Documentation/video4linux/v4l2-framework.txt index 8fb9de4f4875..9b1d81c26b7d 100644 --- a/Documentation/video4linux/v4l2-framework.txt +++ b/Documentation/video4linux/v4l2-framework.txt | |||
@@ -551,9 +551,8 @@ from /dev). | |||
551 | 551 | ||
552 | After video_unregister_device() returns no new opens can be done. However, | 552 | After video_unregister_device() returns no new opens can be done. However, |
553 | in the case of USB devices some application might still have one of these | 553 | in the case of USB devices some application might still have one of these |
554 | device nodes open. So after the unregister all file operations will return | 554 | device nodes open. So after the unregister all file operations (except |
555 | an error as well, except for the ioctl and unlocked_ioctl file operations: | 555 | release, of course) will return an error as well. |
556 | those will still be passed on since some buffer ioctls may still be needed. | ||
557 | 556 | ||
558 | When the last user of the video device node exits, then the vdev->release() | 557 | When the last user of the video device node exits, then the vdev->release() |
559 | callback is called and you can do the final cleanup there. | 558 | callback is called and you can do the final cleanup there. |
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index d4a353260c1e..f069c61cdf68 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -221,8 +221,8 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
221 | struct video_device *vdev = video_devdata(filp); | 221 | struct video_device *vdev = video_devdata(filp); |
222 | int ret; | 222 | int ret; |
223 | 223 | ||
224 | /* Allow ioctl to continue even if the device was unregistered. | 224 | if (!vdev->fops->ioctl) |
225 | Things like dequeueing buffers might still be useful. */ | 225 | return -ENOTTY; |
226 | if (vdev->fops->unlocked_ioctl) { | 226 | if (vdev->fops->unlocked_ioctl) { |
227 | ret = vdev->fops->unlocked_ioctl(filp, cmd, arg); | 227 | ret = vdev->fops->unlocked_ioctl(filp, cmd, arg); |
228 | } else if (vdev->fops->ioctl) { | 228 | } else if (vdev->fops->ioctl) { |