From patchwork Tue Jul 19 11:51:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 35621 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bPTYe-0003wn-Qt; Tue, 19 Jul 2016 11:51:28 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-6) with esmtp id 1bPTYc-0004TX-5w; Tue, 19 Jul 2016 13:51:28 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752995AbcGSLvY (ORCPT + 1 other); Tue, 19 Jul 2016 07:51:24 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:59167 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753009AbcGSLvY (ORCPT ); Tue, 19 Jul 2016 07:51:24 -0400 Received: from ayla.of.borg ([84.193.137.253]) by xavier.telenet-ops.be with bizsmtp id LbrL1t00M5UCtCs01brLy8; Tue, 19 Jul 2016 13:51:21 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1bPTYW-0001bS-NQ; Tue, 19 Jul 2016 13:51:20 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1bPTYZ-0004xv-Mi; Tue, 19 Jul 2016 13:51:23 +0200 From: Geert Uytterhoeven To: Kieran Bingham Cc: Mauro Carvalho Chehab , Hans Verkuil , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [media] fdp1: vb2_queue dev conversion Date: Tue, 19 Jul 2016 13:51:19 +0200 Message-Id: <1468929079-19054-1-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.7.19.114216 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, LEGITIMATE_NEGATE 0, MULTIPLE_RCPTS_RND 0, NO_URI_HTTPS 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0' drivers/media/platform/rcar_fdp1.c:1972:2: warning: initialization from incompatible pointer type .queue_setup = fdp1_queue_setup, ^ drivers/media/platform/rcar_fdp1.c:1972:2: warning: (near initialization for 'fdp1_qops.queue_setup') drivers/media/platform/rcar_fdp1.c: In function 'fdp1_probe': drivers/media/platform/rcar_fdp1.c:2264:2: error: implicit declaration of function 'vb2_dma_contig_init_ctx' [-Werror=implicit-function-declaration] fdp1->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); ^ drivers/media/platform/rcar_fdp1.c:2264:18: warning: assignment makes pointer from integer without a cast fdp1->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); ^ drivers/media/platform/rcar_fdp1.c:2331:2: error: implicit declaration of function 'vb2_dma_contig_cleanup_ctx' [-Werror=implicit-function-declaration] vb2_dma_contig_cleanup_ctx(fdp1->alloc_ctx); ^ Commit 36c0f8b32c4bd4f6 ("[media] vb2: replace void *alloc_ctxs by struct device *alloc_devs") removed the vb2_dma_contig_init_ctx() and vb2_dma_contig_cleanup_ctx() functions, and changed the prototype of vb2_ops.queue_setup(). To fix this: - Update the signature of fdp1_queue_setup(), - Convert the FDP1 driver to use the new vb2_queue dev field, cfr. commit 53ddcc683faef8c7 ("[media] media/platform: convert drivers to use the new vb2_queue dev field"). Signed-off-by: Geert Uytterhoeven --- To be folded into "[PATCH v2] v4l: platform: Add Renesas R-Car FDP1 Driver". --- drivers/media/platform/rcar_fdp1.c | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/rcar_fdp1.c b/drivers/media/platform/rcar_fdp1.c index c7280183262a3046..a2587745ca68dedb 100644 --- a/drivers/media/platform/rcar_fdp1.c +++ b/drivers/media/platform/rcar_fdp1.c @@ -570,7 +570,6 @@ struct fdp1_dev { void __iomem *regs; unsigned int irq; struct device *dev; - void *alloc_ctx; /* Job Queues */ struct fdp1_job jobs[FDP1_NUMBER_JOBS]; @@ -1788,7 +1787,8 @@ static const struct v4l2_ioctl_ops fdp1_ioctl_ops = { static int fdp1_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, unsigned int *nplanes, - unsigned int sizes[], void *alloc_ctxs[]) + unsigned int sizes[], + struct device *alloc_ctxs[]) { struct fdp1_ctx *ctx = vb2_get_drv_priv(vq); struct fdp1_q_data *q_data; @@ -1800,18 +1800,13 @@ static int fdp1_queue_setup(struct vb2_queue *vq, if (*nplanes > FDP1_MAX_PLANES) return -EINVAL; - for (i = 0; i < *nplanes; i++) - alloc_ctxs[i] = ctx->fdp1->alloc_ctx; - return 0; } *nplanes = q_data->format.num_planes; - for (i = 0; i < *nplanes; i++) { + for (i = 0; i < *nplanes; i++) sizes[i] = q_data->format.plane_fmt[i].sizeimage; - alloc_ctxs[i] = ctx->fdp1->alloc_ctx; - } return 0; } @@ -1992,6 +1987,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->fdp1->dev_mutex; + src_vq->dev = ctx->fdp1->dev; ret = vb2_queue_init(src_vq); if (ret) @@ -2005,6 +2001,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->fdp1->dev_mutex; + dst_vq->dev = ctx->fdp1->dev; return vb2_queue_init(dst_vq); } @@ -2260,18 +2257,11 @@ static int fdp1_probe(struct platform_device *pdev) fdp1->clk_rate = clk_get_rate(clk); clk_put(clk); - /* Memory allocation contexts */ - fdp1->alloc_ctx = vb2_dma_contig_init_ctx(&pdev->dev); - if (IS_ERR(fdp1->alloc_ctx)) { - v4l2_err(&fdp1->v4l2_dev, "Failed to init memory allocator\n"); - return PTR_ERR(fdp1->alloc_ctx); - } - /* V4L2 device registration */ ret = v4l2_device_register(&pdev->dev, &fdp1->v4l2_dev); if (ret) { v4l2_err(&fdp1->v4l2_dev, "Failed to register video device\n"); - goto vb2_allocator_rollback; + return ret; } /* M2M registration */ @@ -2327,9 +2317,6 @@ release_m2m: unreg_dev: v4l2_device_unregister(&fdp1->v4l2_dev); -vb2_allocator_rollback: - vb2_dma_contig_cleanup_ctx(fdp1->alloc_ctx); - return ret; } @@ -2340,7 +2327,6 @@ static int fdp1_remove(struct platform_device *pdev) v4l2_m2m_release(fdp1->m2m_dev); video_unregister_device(&fdp1->vfd); v4l2_device_unregister(&fdp1->v4l2_dev); - vb2_dma_contig_cleanup_ctx(fdp1->alloc_ctx); pm_runtime_disable(&pdev->dev); return 0;