diff options
author | Prabhakar Lad <prabhakar.csengg@gmail.com> | 2014-11-26 19:42:31 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-02 11:34:11 -0200 |
commit | 4d655ca4d0b8c2b9918952c8ede392da7fa1c2e5 (patch) | |
tree | 4f8f113d877e8381ca7f4c6a337dc7e99176419f /drivers/media/platform | |
parent | 519694f94bd696778ee4c08cab45499ae1ffa454 (diff) | |
download | op-kernel-dev-4d655ca4d0b8c2b9918952c8ede392da7fa1c2e5.zip op-kernel-dev-4d655ca4d0b8c2b9918952c8ede392da7fa1c2e5.tar.gz |
[media] media: blackfin: use vb2_ops_wait_prepare/finish helper
This patch drops driver specific wait_prepare() and
wait_finish() callbacks from vb2_ops and instead uses
the the helpers vb2_ops_wait_prepare/finish() provided
by the vb2 core, the lock member of the queue needs
to be initalized to a mutex so that vb2 helpers
vb2_ops_wait_prepare/finish() can make use of it.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Scott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r-- | drivers/media/platform/blackfin/bfin_capture.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 431c33d..3112844 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -349,18 +349,6 @@ static void bcap_buffer_cleanup(struct vb2_buffer *vb) spin_unlock_irqrestore(&bcap_dev->lock, flags); } -static void bcap_lock(struct vb2_queue *vq) -{ - struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); - mutex_lock(&bcap_dev->mutex); -} - -static void bcap_unlock(struct vb2_queue *vq) -{ - struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); - mutex_unlock(&bcap_dev->mutex); -} - static int bcap_start_streaming(struct vb2_queue *vq, unsigned int count) { struct bcap_device *bcap_dev = vb2_get_drv_priv(vq); @@ -457,8 +445,8 @@ static struct vb2_ops bcap_video_qops = { .buf_prepare = bcap_buffer_prepare, .buf_cleanup = bcap_buffer_cleanup, .buf_queue = bcap_buffer_queue, - .wait_prepare = bcap_unlock, - .wait_finish = bcap_lock, + .wait_prepare = vb2_ops_wait_prepare, + .wait_finish = vb2_ops_wait_finish, .start_streaming = bcap_start_streaming, .stop_streaming = bcap_stop_streaming, }; @@ -996,6 +984,7 @@ static int bcap_probe(struct platform_device *pdev) q->ops = &bcap_video_qops; q->mem_ops = &vb2_dma_contig_memops; q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; + q->lock = &bcap_dev->mutex; ret = vb2_queue_init(q); if (ret) |