]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blobdiff - drivers/media/v4l2-core/videobuf2-core.c
media: v4l2-core: Migration from upstream
[sojka/nv-tegra/linux-3.10.git] / drivers / media / v4l2-core / videobuf2-core.c
index 5e47ba479e53889984756dc726789dc8b8b4a48d..fbadb03d2be2f89d2bcd3a082d06a3fa252346b5 100644 (file)
@@ -2592,6 +2592,22 @@ int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma)
 }
 EXPORT_SYMBOL_GPL(vb2_fop_mmap);
 
+int _vb2_fop_release(struct file *file, struct mutex *lock)
+{
+       struct video_device *vdev = video_devdata(file);
+
+       if (lock)
+               mutex_lock(lock);
+       if (file->private_data == vdev->queue->owner) {
+               vb2_queue_release(vdev->queue);
+               vdev->queue->owner = NULL;
+       }
+       if (lock)
+               mutex_unlock(lock);
+       return v4l2_fh_release(file);
+}
+EXPORT_SYMBOL_GPL(_vb2_fop_release);
+
 int vb2_fop_release(struct file *file)
 {
        struct video_device *vdev = video_devdata(file);