diff options
author | Lad, Prabhakar <prabhakar.csengg@gmail.com> | 2015-03-08 17:40:40 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-03 00:11:15 +0300 |
commit | cd3c38effc6f7eac1b1aa64ba08dc8d5c5d0c809 (patch) | |
tree | 5631b09180a3ddcf8b91aa94732f668218d2e544 /drivers/media/platform/blackfin | |
parent | 5f65ca81c321e8390645b80460444c3aa04c856f (diff) | |
download | linux-cd3c38effc6f7eac1b1aa64ba08dc8d5c5d0c809.tar.xz |
[media] media: blackfin: bfin_capture: set vb2 buffer field
set the vb2 buffer field in buf_prepare() callback,
alongside drop local variable buf as we already have
a pointer to vb2 buffer.
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Tested-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/blackfin')
-rw-r--r-- | drivers/media/platform/blackfin/bfin_capture.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 332f8c972d11..a5881297c9ea 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -305,16 +305,16 @@ static int bcap_queue_setup(struct vb2_queue *vq, static int bcap_buffer_prepare(struct vb2_buffer *vb) { struct bcap_device *bcap_dev = vb2_get_drv_priv(vb->vb2_queue); - struct bcap_buffer *buf = to_bcap_vb(vb); - unsigned long size; + unsigned long size = bcap_dev->fmt.sizeimage; - size = bcap_dev->fmt.sizeimage; if (vb2_plane_size(vb, 0) < size) { v4l2_err(&bcap_dev->v4l2_dev, "buffer too small (%lu < %lu)\n", vb2_plane_size(vb, 0), size); return -EINVAL; } - vb2_set_plane_payload(&buf->vb, 0, size); + vb2_set_plane_payload(vb, 0, size); + + vb->v4l2_buf.field = bcap_dev->fmt.field; return 0; } |