aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/videobuf-dma-sg.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-09-20 16:24:30 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-20 23:06:14 -0400
commit97397687886aa8ecd4ec603fab9e70e970c11597 (patch)
tree339d460b43d2ec7206c9d147d2ad6f8fcbfa3870 /drivers/media/video/videobuf-dma-sg.c
parentee6869afc922a9849979e49bb3bbcad794872fcb (diff)
V4L/DVB: videobuf: prepare to make locking optional in videobuf
Currently videobuf uses the vb_lock mutex to lock its data structures. But this locking will (optionally) move into the v4l2 core, which means that in that case vb_lock shouldn't be used since the external lock is already held. Prepare for this by adding a pointer to such an external mutex and don't lock if that pointer is set. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
-rw-r--r--drivers/media/video/videobuf-dma-sg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c
index 2ad0bc252b0e..515ae887ffcf 100644
--- a/drivers/media/video/videobuf-dma-sg.c
+++ b/drivers/media/video/videobuf-dma-sg.c
@@ -358,7 +358,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
358 map->count--; 358 map->count--;
359 if (0 == map->count) { 359 if (0 == map->count) {
360 dprintk(1, "munmap %p q=%p\n", map, q); 360 dprintk(1, "munmap %p q=%p\n", map, q);
361 mutex_lock(&q->vb_lock); 361 videobuf_queue_lock(q);
362 for (i = 0; i < VIDEO_MAX_FRAME; i++) { 362 for (i = 0; i < VIDEO_MAX_FRAME; i++) {
363 if (NULL == q->bufs[i]) 363 if (NULL == q->bufs[i])
364 continue; 364 continue;
@@ -374,7 +374,7 @@ static void videobuf_vm_close(struct vm_area_struct *vma)
374 q->bufs[i]->baddr = 0; 374 q->bufs[i]->baddr = 0;
375 q->ops->buf_release(q, q->bufs[i]); 375 q->ops->buf_release(q, q->bufs[i]);
376 } 376 }
377 mutex_unlock(&q->vb_lock); 377 videobuf_queue_unlock(q);
378 kfree(map); 378 kfree(map);
379 } 379 }
380 return; 380 return;