diff options
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 709069916068..0ca7ec9ca902 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -421,6 +421,10 @@ static int __video_register_device(struct video_device *vdev, int type, int nr, | |||
421 | if (!vdev->release) | 421 | if (!vdev->release) |
422 | return -EINVAL; | 422 | return -EINVAL; |
423 | 423 | ||
424 | /* v4l2_fh support */ | ||
425 | spin_lock_init(&vdev->fh_lock); | ||
426 | INIT_LIST_HEAD(&vdev->fh_list); | ||
427 | |||
424 | /* Part 1: check device type */ | 428 | /* Part 1: check device type */ |
425 | switch (type) { | 429 | switch (type) { |
426 | case VFL_TYPE_GRABBER: | 430 | case VFL_TYPE_GRABBER: |
@@ -596,9 +600,7 @@ void video_unregister_device(struct video_device *vdev) | |||
596 | if (!vdev || !video_is_registered(vdev)) | 600 | if (!vdev || !video_is_registered(vdev)) |
597 | return; | 601 | return; |
598 | 602 | ||
599 | mutex_lock(&videodev_lock); | ||
600 | clear_bit(V4L2_FL_REGISTERED, &vdev->flags); | 603 | clear_bit(V4L2_FL_REGISTERED, &vdev->flags); |
601 | mutex_unlock(&videodev_lock); | ||
602 | device_unregister(&vdev->dev); | 604 | device_unregister(&vdev->dev); |
603 | } | 605 | } |
604 | EXPORT_SYMBOL(video_unregister_device); | 606 | EXPORT_SYMBOL(video_unregister_device); |