From dce57314b53760b6f9190c98287ce8f89c80d233 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 15 Feb 2016 13:24:11 -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 Acked-by: Fabien Dessenne Acked-by: Benoit Parrot Reviewed-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/xilinx/xilinx-dma.c | 11 +---------- drivers/media/platform/xilinx/xilinx-dma.h | 2 -- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'drivers/media/platform/xilinx') diff --git a/drivers/media/platform/xilinx/xilinx-dma.c b/drivers/media/platform/xilinx/xilinx-dma.c index 7f6898b13cac..3838e11fc15f 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.c +++ b/drivers/media/platform/xilinx/xilinx-dma.c @@ -322,7 +322,6 @@ xvip_dma_queue_setup(struct vb2_queue *vq, { struct xvip_dma *dma = vb2_get_drv_priv(vq); - alloc_ctxs[0] = dma->alloc_ctx; /* Make sure the image size is large enough. */ if (*nplanes) return sizes[0] < dma->format.sizeimage ? -EINVAL : 0; @@ -706,12 +705,6 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, video_set_drvdata(&dma->video, dma); /* ... and the buffers queue... */ - dma->alloc_ctx = vb2_dma_contig_init_ctx(dma->xdev->dev); - if (IS_ERR(dma->alloc_ctx)) { - ret = PTR_ERR(dma->alloc_ctx); - goto error; - } - /* Don't enable VB2_READ and VB2_WRITE, as using the read() and write() * V4L2 APIs would be inefficient. Testing on the command line with a * 'cat /dev/video?' thus won't be possible, but given that the driver @@ -728,6 +721,7 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma, dma->queue.mem_ops = &vb2_dma_contig_memops; dma->queue.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC | V4L2_BUF_FLAG_TSTAMP_SRC_EOF; + dma->queue.dev = dma->xdev->dev; ret = vb2_queue_init(&dma->queue); if (ret < 0) { dev_err(dma->xdev->dev, "failed to initialize VB2 queue\n"); @@ -766,9 +760,6 @@ void xvip_dma_cleanup(struct xvip_dma *dma) if (dma->dma) dma_release_channel(dma->dma); - if (!IS_ERR_OR_NULL(dma->alloc_ctx)) - vb2_dma_contig_cleanup_ctx(dma->alloc_ctx); - media_entity_cleanup(&dma->video.entity); mutex_destroy(&dma->lock); diff --git a/drivers/media/platform/xilinx/xilinx-dma.h b/drivers/media/platform/xilinx/xilinx-dma.h index 7a1621a2ef40..e95d136c153a 100644 --- a/drivers/media/platform/xilinx/xilinx-dma.h +++ b/drivers/media/platform/xilinx/xilinx-dma.h @@ -65,7 +65,6 @@ static inline struct xvip_pipeline *to_xvip_pipeline(struct media_entity *e) * @format: active V4L2 pixel format * @fmtinfo: format information corresponding to the active @format * @queue: vb2 buffers queue - * @alloc_ctx: allocation context for the vb2 @queue * @sequence: V4L2 buffers sequence number * @queued_bufs: list of queued buffers * @queued_lock: protects the buf_queued list @@ -88,7 +87,6 @@ struct xvip_dma { const struct xvip_video_format *fmtinfo; struct vb2_queue queue; - void *alloc_ctx; unsigned int sequence; struct list_head queued_bufs; -- cgit v1.2.3