aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/platform/exynos4-is/fimc-capture.c2
-rw-r--r--drivers/media/platform/exynos4-is/fimc-lite.c2
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c15
-rw-r--r--include/media/videobuf2-core.h1
4 files changed, 17 insertions, 3 deletions
diff --git a/drivers/media/platform/exynos4-is/fimc-capture.c b/drivers/media/platform/exynos4-is/fimc-capture.c
index fb27ff7e1e07..8a712ca91d11 100644
--- a/drivers/media/platform/exynos4-is/fimc-capture.c
+++ b/drivers/media/platform/exynos4-is/fimc-capture.c
@@ -549,7 +549,7 @@ static int fimc_capture_release(struct file *file)
549 vc->streaming = false; 549 vc->streaming = false;
550 } 550 }
551 551
552 ret = vb2_fop_release(file); 552 ret = _vb2_fop_release(file, NULL);
553 553
554 if (close) { 554 if (close) {
555 clear_bit(ST_CAPT_BUSY, &fimc->state); 555 clear_bit(ST_CAPT_BUSY, &fimc->state);
diff --git a/drivers/media/platform/exynos4-is/fimc-lite.c b/drivers/media/platform/exynos4-is/fimc-lite.c
index e5798f70d149..d3b32b6f795d 100644
--- a/drivers/media/platform/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/exynos4-is/fimc-lite.c
@@ -546,7 +546,7 @@ static int fimc_lite_release(struct file *file)
546 mutex_unlock(&entity->parent->graph_mutex); 546 mutex_unlock(&entity->parent->graph_mutex);
547 } 547 }
548 548
549 vb2_fop_release(file); 549 _vb2_fop_release(file, NULL);
550 pm_runtime_put(&fimc->pdev->dev); 550 pm_runtime_put(&fimc->pdev->dev);
551 clear_bit(ST_FLITE_SUSPENDED, &fimc->state); 551 clear_bit(ST_FLITE_SUSPENDED, &fimc->state);
552 552
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 144caf12fb6c..f61a79fc1cce 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2632,16 +2632,29 @@ int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma)
2632} 2632}
2633EXPORT_SYMBOL_GPL(vb2_fop_mmap); 2633EXPORT_SYMBOL_GPL(vb2_fop_mmap);
2634 2634
2635int vb2_fop_release(struct file *file) 2635int _vb2_fop_release(struct file *file, struct mutex *lock)
2636{ 2636{
2637 struct video_device *vdev = video_devdata(file); 2637 struct video_device *vdev = video_devdata(file);
2638 2638
2639 if (file->private_data == vdev->queue->owner) { 2639 if (file->private_data == vdev->queue->owner) {
2640 if (lock)
2641 mutex_lock(lock);
2640 vb2_queue_release(vdev->queue); 2642 vb2_queue_release(vdev->queue);
2641 vdev->queue->owner = NULL; 2643 vdev->queue->owner = NULL;
2644 if (lock)
2645 mutex_unlock(lock);
2642 } 2646 }
2643 return v4l2_fh_release(file); 2647 return v4l2_fh_release(file);
2644} 2648}
2649EXPORT_SYMBOL_GPL(_vb2_fop_release);
2650
2651int vb2_fop_release(struct file *file)
2652{
2653 struct video_device *vdev = video_devdata(file);
2654 struct mutex *lock = vdev->queue->lock ? vdev->queue->lock : vdev->lock;
2655
2656 return _vb2_fop_release(file, lock);
2657}
2645EXPORT_SYMBOL_GPL(vb2_fop_release); 2658EXPORT_SYMBOL_GPL(vb2_fop_release);
2646 2659
2647ssize_t vb2_fop_write(struct file *file, const char __user *buf, 2660ssize_t vb2_fop_write(struct file *file, const char __user *buf,
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 941055e9d125..0ae974ee8894 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -491,6 +491,7 @@ int vb2_ioctl_expbuf(struct file *file, void *priv,
491 491
492int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma); 492int vb2_fop_mmap(struct file *file, struct vm_area_struct *vma);
493int vb2_fop_release(struct file *file); 493int vb2_fop_release(struct file *file);
494int _vb2_fop_release(struct file *file, struct mutex *lock);
494ssize_t vb2_fop_write(struct file *file, const char __user *buf, 495ssize_t vb2_fop_write(struct file *file, const char __user *buf,
495 size_t count, loff_t *ppos); 496 size_t count, loff_t *ppos);
496ssize_t vb2_fop_read(struct file *file, char __user *buf, 497ssize_t vb2_fop_read(struct file *file, char __user *buf,