Commit 06470642 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vb2: change result code of buf_finish to void

The buf_finish op should always work, so change the return type to void.
Update the few drivers that use it.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarPawel Osciak <pawel@osciak.com>
Reviewed-by: default avatarPawel Osciak <pawel@osciak.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent b5b4541e
...@@ -667,7 +667,7 @@ static void buffer_queue(struct vb2_buffer *vb) ...@@ -667,7 +667,7 @@ static void buffer_queue(struct vb2_buffer *vb)
vb2_buffer_done(vb, VB2_BUF_STATE_DONE); vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
} }
static int buffer_finish(struct vb2_buffer *vb) static void buffer_finish(struct vb2_buffer *vb)
{ {
struct qcam *qcam = vb2_get_drv_priv(vb->vb2_queue); struct qcam *qcam = vb2_get_drv_priv(vb->vb2_queue);
void *vbuf = vb2_plane_vaddr(vb, 0); void *vbuf = vb2_plane_vaddr(vb, 0);
...@@ -691,7 +691,6 @@ static int buffer_finish(struct vb2_buffer *vb) ...@@ -691,7 +691,6 @@ static int buffer_finish(struct vb2_buffer *vb)
if (len != size) if (len != size)
vb->state = VB2_BUF_STATE_ERROR; vb->state = VB2_BUF_STATE_ERROR;
vb2_set_plane_payload(vb, 0, len); vb2_set_plane_payload(vb, 0, len);
return 0;
} }
static struct vb2_ops qcam_video_qops = { static struct vb2_ops qcam_video_qops = {
......
...@@ -327,7 +327,7 @@ static void buffer_queue(struct vb2_buffer *vb) ...@@ -327,7 +327,7 @@ static void buffer_queue(struct vb2_buffer *vb)
} }
spin_unlock(&vip->lock); spin_unlock(&vip->lock);
} }
static int buffer_finish(struct vb2_buffer *vb) static void buffer_finish(struct vb2_buffer *vb)
{ {
struct sta2x11_vip *vip = vb2_get_drv_priv(vb->vb2_queue); struct sta2x11_vip *vip = vb2_get_drv_priv(vb->vb2_queue);
struct vip_buffer *vip_buf = to_vip_buffer(vb); struct vip_buffer *vip_buf = to_vip_buffer(vb);
...@@ -338,8 +338,6 @@ static int buffer_finish(struct vb2_buffer *vb) ...@@ -338,8 +338,6 @@ static int buffer_finish(struct vb2_buffer *vb)
spin_unlock(&vip->lock); spin_unlock(&vip->lock);
vip_active_buf_next(vip); vip_active_buf_next(vip);
return 0;
} }
static int start_streaming(struct vb2_queue *vq, unsigned int count) static int start_streaming(struct vb2_queue *vq, unsigned int count)
......
...@@ -1238,7 +1238,7 @@ static int mcam_vb_sg_buf_prepare(struct vb2_buffer *vb) ...@@ -1238,7 +1238,7 @@ static int mcam_vb_sg_buf_prepare(struct vb2_buffer *vb)
return 0; return 0;
} }
static int mcam_vb_sg_buf_finish(struct vb2_buffer *vb) static void mcam_vb_sg_buf_finish(struct vb2_buffer *vb)
{ {
struct mcam_camera *cam = vb2_get_drv_priv(vb->vb2_queue); struct mcam_camera *cam = vb2_get_drv_priv(vb->vb2_queue);
struct sg_table *sg_table = vb2_dma_sg_plane_desc(vb, 0); struct sg_table *sg_table = vb2_dma_sg_plane_desc(vb, 0);
...@@ -1246,7 +1246,6 @@ static int mcam_vb_sg_buf_finish(struct vb2_buffer *vb) ...@@ -1246,7 +1246,6 @@ static int mcam_vb_sg_buf_finish(struct vb2_buffer *vb)
if (sg_table) if (sg_table)
dma_unmap_sg(cam->dev, sg_table->sgl, dma_unmap_sg(cam->dev, sg_table->sgl,
sg_table->nents, DMA_FROM_DEVICE); sg_table->nents, DMA_FROM_DEVICE);
return 0;
} }
static void mcam_vb_sg_buf_cleanup(struct vb2_buffer *vb) static void mcam_vb_sg_buf_cleanup(struct vb2_buffer *vb)
......
...@@ -614,7 +614,7 @@ static int buffer_prepare(struct vb2_buffer *vb) ...@@ -614,7 +614,7 @@ static int buffer_prepare(struct vb2_buffer *vb)
return 0; return 0;
} }
static int buffer_finish(struct vb2_buffer *vb) static void buffer_finish(struct vb2_buffer *vb)
{ {
struct pwc_device *pdev = vb2_get_drv_priv(vb->vb2_queue); struct pwc_device *pdev = vb2_get_drv_priv(vb->vb2_queue);
struct pwc_frame_buf *buf = container_of(vb, struct pwc_frame_buf, vb); struct pwc_frame_buf *buf = container_of(vb, struct pwc_frame_buf, vb);
...@@ -624,7 +624,7 @@ static int buffer_finish(struct vb2_buffer *vb) ...@@ -624,7 +624,7 @@ static int buffer_finish(struct vb2_buffer *vb)
* filled, take the pwc data we've stored in buf->data and decompress * filled, take the pwc data we've stored in buf->data and decompress
* it into a usable format, storing the result in the vb2_buffer * it into a usable format, storing the result in the vb2_buffer
*/ */
return pwc_decompress(pdev, buf); pwc_decompress(pdev, buf);
} }
static void buffer_cleanup(struct vb2_buffer *vb) static void buffer_cleanup(struct vb2_buffer *vb)
......
...@@ -106,7 +106,7 @@ static void uvc_buffer_queue(struct vb2_buffer *vb) ...@@ -106,7 +106,7 @@ static void uvc_buffer_queue(struct vb2_buffer *vb)
spin_unlock_irqrestore(&queue->irqlock, flags); spin_unlock_irqrestore(&queue->irqlock, flags);
} }
static int uvc_buffer_finish(struct vb2_buffer *vb) static void uvc_buffer_finish(struct vb2_buffer *vb)
{ {
struct uvc_video_queue *queue = vb2_get_drv_priv(vb->vb2_queue); struct uvc_video_queue *queue = vb2_get_drv_priv(vb->vb2_queue);
struct uvc_streaming *stream = struct uvc_streaming *stream =
...@@ -114,7 +114,6 @@ static int uvc_buffer_finish(struct vb2_buffer *vb) ...@@ -114,7 +114,6 @@ static int uvc_buffer_finish(struct vb2_buffer *vb)
struct uvc_buffer *buf = container_of(vb, struct uvc_buffer, buf); struct uvc_buffer *buf = container_of(vb, struct uvc_buffer, buf);
uvc_video_clock_update(stream, &vb->v4l2_buf, buf); uvc_video_clock_update(stream, &vb->v4l2_buf, buf);
return 0;
} }
static void uvc_wait_prepare(struct vb2_queue *vq) static void uvc_wait_prepare(struct vb2_queue *vq)
......
...@@ -1834,11 +1834,7 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool n ...@@ -1834,11 +1834,7 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool n
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = call_vb_qop(vb, buf_finish, vb); call_vb_qop(vb, buf_finish, vb);
if (ret) {
dprintk(1, "dqbuf: buffer finish failed\n");
return ret;
}
switch (vb->state) { switch (vb->state) {
case VB2_BUF_STATE_DONE: case VB2_BUF_STATE_DONE:
......
...@@ -470,7 +470,7 @@ static int go7007_buf_prepare(struct vb2_buffer *vb) ...@@ -470,7 +470,7 @@ static int go7007_buf_prepare(struct vb2_buffer *vb)
return 0; return 0;
} }
static int go7007_buf_finish(struct vb2_buffer *vb) static void go7007_buf_finish(struct vb2_buffer *vb)
{ {
struct vb2_queue *vq = vb->vb2_queue; struct vb2_queue *vq = vb->vb2_queue;
struct go7007 *go = vb2_get_drv_priv(vq); struct go7007 *go = vb2_get_drv_priv(vq);
...@@ -483,7 +483,6 @@ static int go7007_buf_finish(struct vb2_buffer *vb) ...@@ -483,7 +483,6 @@ static int go7007_buf_finish(struct vb2_buffer *vb)
V4L2_BUF_FLAG_PFRAME); V4L2_BUF_FLAG_PFRAME);
buf->flags |= frame_type_flag; buf->flags |= frame_type_flag;
buf->field = V4L2_FIELD_NONE; buf->field = V4L2_FIELD_NONE;
return 0;
} }
static int go7007_start_streaming(struct vb2_queue *q, unsigned int count) static int go7007_start_streaming(struct vb2_queue *q, unsigned int count)
......
...@@ -311,7 +311,7 @@ struct vb2_ops { ...@@ -311,7 +311,7 @@ struct vb2_ops {
int (*buf_init)(struct vb2_buffer *vb); int (*buf_init)(struct vb2_buffer *vb);
int (*buf_prepare)(struct vb2_buffer *vb); int (*buf_prepare)(struct vb2_buffer *vb);
int (*buf_finish)(struct vb2_buffer *vb); void (*buf_finish)(struct vb2_buffer *vb);
void (*buf_cleanup)(struct vb2_buffer *vb); void (*buf_cleanup)(struct vb2_buffer *vb);
int (*start_streaming)(struct vb2_queue *q, unsigned int count); int (*start_streaming)(struct vb2_queue *q, unsigned int count);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment