From 1ad70ced1bdafa93938caf57edc2de2b461c539b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 15 Feb 2016 13:41:51 -0200 Subject: [media] media/platform: convert drivers to use the new vb2_queue dev field Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil Reviewed-by: Laurent Pinchart Cc: Mikhail Ulyanov Cc: Guennadi Liakhovetski Cc: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/sh_vou.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers/media/platform/sh_vou.c') diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c index 1157404..59830a4 100644 --- a/drivers/media/platform/sh_vou.c +++ b/drivers/media/platform/sh_vou.c @@ -86,7 +86,6 @@ struct sh_vou_device { v4l2_std_id std; int pix_idx; struct vb2_queue queue; - struct vb2_alloc_ctx *alloc_ctx; struct sh_vou_buffer *active; enum sh_vou_status status; unsigned sequence; @@ -253,7 +252,6 @@ static int sh_vou_queue_setup(struct vb2_queue *vq, dev_dbg(vou_dev->v4l2_dev.dev, "%s()\n", __func__); - alloc_ctxs[0] = vou_dev->alloc_ctx; if (*nplanes) return sizes[0] < pix->height * bytes_per_line ? -EINVAL : 0; *nplanes = 1; @@ -1304,16 +1302,11 @@ static int sh_vou_probe(struct platform_device *pdev) q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; q->min_buffers_needed = 2; q->lock = &vou_dev->fop_lock; + q->dev = &pdev->dev; ret = vb2_queue_init(q); if (ret) - goto einitctx; + goto ei2cgadap; - vou_dev->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); - if (IS_ERR(vou_dev->alloc_ctx)) { - dev_err(&pdev->dev, "Can't allocate buffer context"); - ret = PTR_ERR(vou_dev->alloc_ctx); - goto einitctx; - } vdev->queue = q; INIT_LIST_HEAD(&vou_dev->buf_list); @@ -1348,8 +1341,6 @@ ei2cnd: ereset: i2c_put_adapter(i2c_adap); ei2cgadap: - vb2_dma_contig_cleanup_ctx(vou_dev->alloc_ctx); -einitctx: pm_runtime_disable(&pdev->dev); v4l2_device_unregister(&vou_dev->v4l2_dev); return ret; @@ -1367,7 +1358,6 @@ static int sh_vou_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); video_unregister_device(&vou_dev->vdev); i2c_put_adapter(client->adapter); - vb2_dma_contig_cleanup_ctx(vou_dev->alloc_ctx); v4l2_device_unregister(&vou_dev->v4l2_dev); return 0; } -- cgit v1.1