diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2016-02-15 19:25:09 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-07-08 20:42:09 +0300 |
commit | c781e4a565a6791d3b516d64d9693804ef4a49b8 (patch) | |
tree | fcc8d83243fc98407ebf6937d8ea7ef89c5e2e6b /drivers/media/platform/s5p-jpeg | |
parent | 8e9bca3a260ccacbdc3c852d6dd8f21801b82266 (diff) | |
download | linux-c781e4a565a6791d3b516d64d9693804ef4a49b8.tar.xz |
[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 <hans.verkuil@cisco.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/s5p-jpeg')
-rw-r--r-- | drivers/media/platform/s5p-jpeg/jpeg-core.c | 17 | ||||
-rw-r--r-- | drivers/media/platform/s5p-jpeg/jpeg-core.h | 2 |
2 files changed, 4 insertions, 15 deletions
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 17bc94092864..d8842c482f0c 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -2457,7 +2457,6 @@ static int s5p_jpeg_queue_setup(struct vb2_queue *vq, *nbuffers = count; *nplanes = 1; sizes[0] = size; - alloc_ctxs[0] = ctx->jpeg->alloc_ctx; return 0; } @@ -2563,6 +2562,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, src_vq->mem_ops = &vb2_dma_contig_memops; src_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; src_vq->lock = &ctx->jpeg->lock; + src_vq->dev = ctx->jpeg->dev; ret = vb2_queue_init(src_vq); if (ret) @@ -2576,6 +2576,7 @@ static int queue_init(void *priv, struct vb2_queue *src_vq, dst_vq->mem_ops = &vb2_dma_contig_memops; dst_vq->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_COPY; dst_vq->lock = &ctx->jpeg->lock; + dst_vq->dev = ctx->jpeg->dev; return vb2_queue_init(dst_vq); } @@ -2844,19 +2845,13 @@ static int s5p_jpeg_probe(struct platform_device *pdev) } vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); - jpeg->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); - if (IS_ERR(jpeg->alloc_ctx)) { - v4l2_err(&jpeg->v4l2_dev, "Failed to init memory allocator\n"); - ret = PTR_ERR(jpeg->alloc_ctx); - goto m2m_init_rollback; - } /* JPEG encoder /dev/videoX node */ jpeg->vfd_encoder = video_device_alloc(); if (!jpeg->vfd_encoder) { v4l2_err(&jpeg->v4l2_dev, "Failed to allocate video device\n"); ret = -ENOMEM; - goto vb2_allocator_rollback; + goto m2m_init_rollback; } snprintf(jpeg->vfd_encoder->name, sizeof(jpeg->vfd_encoder->name), "%s-enc", S5P_JPEG_M2M_NAME); @@ -2872,7 +2867,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev) if (ret) { v4l2_err(&jpeg->v4l2_dev, "Failed to register video device\n"); video_device_release(jpeg->vfd_encoder); - goto vb2_allocator_rollback; + goto m2m_init_rollback; } video_set_drvdata(jpeg->vfd_encoder, jpeg); @@ -2921,9 +2916,6 @@ static int s5p_jpeg_probe(struct platform_device *pdev) enc_vdev_register_rollback: video_unregister_device(jpeg->vfd_encoder); -vb2_allocator_rollback: - vb2_dma_contig_cleanup_ctx(jpeg->alloc_ctx); - m2m_init_rollback: v4l2_m2m_release(jpeg->m2m_dev); @@ -2942,7 +2934,6 @@ static int s5p_jpeg_remove(struct platform_device *pdev) video_unregister_device(jpeg->vfd_decoder); video_unregister_device(jpeg->vfd_encoder); - vb2_dma_contig_cleanup_ctx(jpeg->alloc_ctx); vb2_dma_contig_clear_max_seg_size(&pdev->dev); v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.h b/drivers/media/platform/s5p-jpeg/jpeg-core.h index 9b1db0934909..4492a3535df5 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.h +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.h @@ -110,7 +110,6 @@ enum exynos4_jpeg_img_quality_level { * @irq: JPEG IP irq * @clocks: JPEG IP clock(s) * @dev: JPEG IP struct device - * @alloc_ctx: videobuf2 memory allocator's context * @variant: driver variant to be used * @irq_status interrupt flags set during single encode/decode operation @@ -130,7 +129,6 @@ struct s5p_jpeg { enum exynos4_jpeg_result irq_ret; struct clk *clocks[JPEG_MAX_CLOCKS]; struct device *dev; - void *alloc_ctx; struct s5p_jpeg_variant *variant; u32 irq_status; }; |