From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9243BCCD1AA for ; Mon, 20 Oct 2025 11:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PlkUFAWn1mzv4fjPax9Q7DA3MWIuI4KWL6LfATeh7bs=; b=G0ktXQlAhCd1m+ Badv5wcVsn8XgvmMhodCooAsQNOTNJ2A4Qcm5XzVjUDzlCg9NpFAnViUCsCLbZFavk+0PlP0mQOXh hO8lFEdgE6n2V1v4D5mIj0YUDQIslXKovu4HqkN4f3NetltJFnjF/OeW9VfQoyHPJwndPppvHAAYQ Yb/WvusMGot6T6tgXiN4u+dRK6RaMYaZBIALBbuTVseUPsgrh3X/uWzc0pf9TO/BOakTt2G1jBM+0 eEbv/afkAy0tgZxDaVBgvBXaf3BR/d9MH4EeqDTf0e2NWrB4+C9XRODACQ6bHnXaYobC/Rlupt7yM A7bjI1zmxx2P+JXmveOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vAoWy-0000000DAqY-0HTI; Mon, 20 Oct 2025 11:58:28 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1ui8Z4-00000007Qay-0iBs; Sat, 02 Aug 2025 09:30:07 +0000 Received: from [192.168.0.172] (mob-5-90-138-121.net.vodafone.it [5.90.138.121]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EDA0D3C97; Sat, 2 Aug 2025 11:29:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1754126959; bh=DR8H5PIAc8L4JOzfoP4xWpCxebhDCEnaJqqWhPBFy+0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=hT8Gx6BmOM76bDFeML8LExuJPTAnht6Wvn57/qJhB7+ZhlNMqfXhEkASH3NW3RuyW UZTqUXH/j8H6xn9lPsNIuJ1E2Ht2wzHcwFHMec6ZTXX4zFnaK3T8vOqZ9UuNg86A45 wLsnMm4kFRwPqYJBTI/nmtZ/BWbP+cVS1qJzP4Mw= From: Jacopo Mondi Date: Sat, 02 Aug 2025 11:23:02 +0200 Subject: [PATCH 40/65] media: imx-isi: Access v4l2_fh from file MIME-Version: 1.0 Message-Id: <20250802-media-private-data-v1-40-eb140ddd6a9d@ideasonboard.com> References: <20250802-media-private-data-v1-0-eb140ddd6a9d@ideasonboard.com> In-Reply-To: <20250802-media-private-data-v1-0-eb140ddd6a9d@ideasonboard.com> To: Mauro Carvalho Chehab , Devarsh Thakkar , Benoit Parrot , Hans Verkuil , Mike Isely , Laurent Pinchart , Hans de Goede , Parthiban Veerasooran , Christian Gromm , Greg Kroah-Hartman , Alex Shi , Yanteng Si , Dongliang Mu , Jonathan Corbet , Tomasz Figa , Marek Szyprowski , Andy Walls , Michael Tretter , Pengutronix Kernel Team , Bin Liu , Matthias Brugger , AngeloGioacchino Del Regno , Dmitry Osipenko , Thierry Reding , Jonathan Hunter , Mirela Rabulea , Shawn Guo , Sascha Hauer , Fabio Estevam , Kieran Bingham , Michal Simek , Ming Qian , Zhou Peng , Xavier Roumegue , Philipp Zabel , Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Sylwester Nawrocki , Jernej Skrabec , Chen-Yu Tsai , Samuel Holland , Daniel Almeida , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Nas Chung , Jackson Lee , Minghsiu Tsai , Houlong Wei , Andrew-CT Chen , Tiffany Lin , Yunfei Dong , Geert Uytterhoeven , Magnus Damm , Mikhail Ulyanov , Jacob Chen , Ezequiel Garcia , Heiko Stuebner , Detlev Casanova , Krzysztof Kozlowski , Alim Akhtar , Sylwester Nawrocki , =?utf-8?q?=C5=81ukasz_Stelmach?= , Andrzej Pietrasiewicz , Jacek Anaszewski , Andrzej Hajda , Fabien Dessenne , Hugues Fruchet , Jean-Christophe Trotin , Maxime Coquelin , Alexandre Torgue , Nicolas Dufresne , Benjamin Gaignard , Steve Longerbeam , Maxime Ripard , Paul Kocialkowski , =?utf-8?q?Niklas_S=C3=B6derlund?= , Robert Foss , Todor Tomov , Vladimir Zapolskiy , Corentin Labbe , Sakari Ailus , Bingbu Cao , Tianshu Qiu , Stanislaw Gruszka Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev, linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org, imx@lists.linux.dev, linux-renesas-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-usb@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, mjpeg-users@lists.sourceforge.net, Jacopo Mondi X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3477; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=DR8H5PIAc8L4JOzfoP4xWpCxebhDCEnaJqqWhPBFy+0=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBojdj8EoZgkMCHL3+wASHVhjTV75Orj6SKgaDZA 6AcS4LUd4KJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaI3Y/AAKCRByNAaPFqFW POVpD/9a3Ls6bK9algAcZ2oeiBjNz7tRIjEIwEqB46qB5Bq/kQDbriurqxVTCwNigHT9yYh0mXP 7cACNJ33RBJeyO9365kZBXs/wmIKGs/p4y+dJ8d2bdWddvcupEtgqZNitoozeu7ESiwRcXbm3y+ BoqB1V1jDTE11ypab29+vcaKo4qzSBIP3Hrtk4YeBKLn7gvYgaFBrNEonU6NKD9ODA/LIQulZRe 73jR/l7r+PYcnZ7Rx2T3rwKBgs8D83nyaNr0oEZik56YfleC18XsXP3MSfruSvbfjD6GZWeNrgd 712W4aBRF81a+B6kH5V8Aovltk00OUqLELIBHSUZ7El7W4Me1pXr/QPd6vAC1H+DRpxf2j40+RN TDxqmDHi3YGoi8kJ0PnEMVgSCBCaLXRuhS8dGLvwvkIDAcuHVFiPB8byYSwpkGOYBKB7luuYB7H 4xIhq9bAWnGPh09Xfuwcd9HL+8K5DLRYr1sqRYZZ55yszHbxWsYKKm4yD7EKfvDRiOMJb3LBBrX Z35HmnmFMEe15m2PWocAX01Sgl4eA0YFESsMERAWjZQgueknFQDoJGsL4JOMUxeaYI6kcUScc+3 RYuRDI3FkGlEJpgXEYQ+q+gim7m/X5v4sL1NiwSpLY259tUn9RHwSBlkYDikigIZORsM45vlmyz zSJL01P1ffA0xNA== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250802_023006_356996_E5231000 X-CRM114-Status: GOOD ( 11.27 ) X-Mailman-Approved-At: Mon, 20 Oct 2025 04:56:56 -0700 X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The v4l2_fh associated with an open file handle is now guaranteed to be available in file->private_data, initialised by v4l2_fh_add(). Access the v4l2_fh, and from there the driver-specific structure, from the file * in all ioctl handlers. While at it, remove the now unused to_isi_m2m_ctx() macro. Signed-off-by: Jacopo Mondi --- drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c index 850dd8ae95841d4470ac6bd7cb1e54a7510d6d5e..5501214cc6c0ce3e0188ae6d4ff4ae277b975911 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c @@ -74,11 +74,6 @@ to_isi_m2m_buffer(struct vb2_v4l2_buffer *buf) return container_of(buf, struct mxc_isi_m2m_buffer, buf.vb); } -static inline struct mxc_isi_m2m_ctx *to_isi_m2m_ctx(struct v4l2_fh *fh) -{ - return container_of(fh, struct mxc_isi_m2m_ctx, fh); -} - static inline struct mxc_isi_m2m_ctx *file_to_isi_m2m_ctx(struct file *filp) { return container_of(file_to_v4l2_fh(filp), struct mxc_isi_m2m_ctx, fh); @@ -432,7 +427,7 @@ static int mxc_isi_m2m_try_fmt_vid(struct file *file, void *fh, const enum mxc_isi_video_type type = f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ? MXC_ISI_VIDEO_M2M_OUT : MXC_ISI_VIDEO_M2M_CAP; - struct mxc_isi_m2m_ctx *ctx = to_isi_m2m_ctx(fh); + struct mxc_isi_m2m_ctx *ctx = file_to_isi_m2m_ctx(file); __mxc_isi_m2m_try_fmt_vid(ctx, &f->fmt.pix_mp, type); @@ -442,7 +437,7 @@ static int mxc_isi_m2m_try_fmt_vid(struct file *file, void *fh, static int mxc_isi_m2m_g_fmt_vid(struct file *file, void *fh, struct v4l2_format *f) { - struct mxc_isi_m2m_ctx *ctx = to_isi_m2m_ctx(fh); + struct mxc_isi_m2m_ctx *ctx = file_to_isi_m2m_ctx(file); const struct mxc_isi_m2m_ctx_queue_data *qdata = mxc_isi_m2m_ctx_qdata(ctx, f->type); @@ -457,7 +452,7 @@ static int mxc_isi_m2m_s_fmt_vid(struct file *file, void *fh, const enum mxc_isi_video_type type = f->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE ? MXC_ISI_VIDEO_M2M_OUT : MXC_ISI_VIDEO_M2M_CAP; - struct mxc_isi_m2m_ctx *ctx = to_isi_m2m_ctx(fh); + struct mxc_isi_m2m_ctx *ctx = file_to_isi_m2m_ctx(file); struct v4l2_pix_format_mplane *pix = &f->fmt.pix_mp; const struct mxc_isi_format_info *info; struct vb2_queue *vq; @@ -489,7 +484,7 @@ static int mxc_isi_m2m_s_fmt_vid(struct file *file, void *fh, static int mxc_isi_m2m_streamon(struct file *file, void *fh, enum v4l2_buf_type type) { - struct mxc_isi_m2m_ctx *ctx = to_isi_m2m_ctx(fh); + struct mxc_isi_m2m_ctx *ctx = file_to_isi_m2m_ctx(file); struct mxc_isi_m2m_ctx_queue_data *q = mxc_isi_m2m_ctx_qdata(ctx, type); const struct v4l2_pix_format_mplane *out_pix = &ctx->queues.out.format; const struct v4l2_pix_format_mplane *cap_pix = &ctx->queues.cap.format; @@ -577,7 +572,7 @@ static int mxc_isi_m2m_streamon(struct file *file, void *fh, static int mxc_isi_m2m_streamoff(struct file *file, void *fh, enum v4l2_buf_type type) { - struct mxc_isi_m2m_ctx *ctx = to_isi_m2m_ctx(fh); + struct mxc_isi_m2m_ctx *ctx = file_to_isi_m2m_ctx(file); struct mxc_isi_m2m_ctx_queue_data *q = mxc_isi_m2m_ctx_qdata(ctx, type); struct mxc_isi_m2m *m2m = ctx->m2m; -- 2.49.0 _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip