From nobody Sun Oct 5 16:16:34 2025 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6666283159; Sat, 2 Aug 2025 09:33:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754127201; cv=none; b=qNA4bfTbcC2EqPL2mxuG0Ctr8++ASs9VMaNiW24NYnHnBsTmgo3D8UxoJjC9LkmTkoVI4srhdxGJKx6up2sMTNpH80K2I2qhefHN1tTHemgjMGmKDhWHYUN+AaRzu3UCXB34rah6FinJTdHXbWQ6LKKty+ffrGLrBtL7ACVFtnA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754127201; c=relaxed/simple; bh=Y80t6mB4iwBQesQdO4LMCe3YSMTXsJXe2CdPx2tZgnM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UFg/OFH1RzeL7Cc6n/9SSCgO7Q953Lp6qc9L8KoAFVcgLWPQ7PVC/qhasMH8uKeEb3IdhRIbSno/vNeO0tdxze87I5uAuQdu3V8RuJD3YjmgTeh/nvbvZtjF8fVHUyf7Agpo+creSBMsiqiBoFjwBG///buKwg2mVfAeb7sH5I0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=HbDZkGyP; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="HbDZkGyP" 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 6D376EA0; Sat, 2 Aug 2025 11:32:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1754127152; bh=Y80t6mB4iwBQesQdO4LMCe3YSMTXsJXe2CdPx2tZgnM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=HbDZkGyPReuTqOUXC4XHvtVbecmjFjkvn9QhJ0swKjQNlvhX4OF1EMulXh30ASkzt N9fqCk2OHTyciiwGn7MpBubDw2OX/r2v3IlRdXILvymYskKIxuLeBDm9MbMPNzNusL nwkNIoughd8Iq0CCaXEm6KLMQF2/2xUQeORvtiSM= From: Jacopo Mondi Date: Sat, 02 Aug 2025 11:23:19 +0200 Subject: [PATCH 57/65] media: ivtv: Access v4l2_fh from file Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250802-media-private-data-v1-57-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=22060; i=jacopo.mondi@ideasonboard.com; h=from:subject:message-id; bh=Y80t6mB4iwBQesQdO4LMCe3YSMTXsJXe2CdPx2tZgnM=; b=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBojdj+/vd8qdz5//sT07XduRB8DRKCpHK7o4Fbl m7SrCBEp6OJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaI3Y/gAKCRByNAaPFqFW PIvnD/93dcaaiVIv4xP4TjJUecfS+KksaInR7XVJ9lOTjDhNOGP/MA1HqTEI46kfkiDDOTqOwA6 Y4v43HX2/p9BqmBQ++L/6yhnRUHGpzMLbcYPl/plBKjEGX5Rq5f+WiBf185PrseXD4ZdxWkS7OO 5fkexLYYfixbUAYAKeSUF8K34JBxU6+xbaozfQqrtF5pPau0v5uJMCorHOY4PNbFiQQSZZKTISS 3J7f8BAim1cqQOxtXMIZDe72HYeI38zijMOr9GwPVdVVPB4Ha11Ab4Zk0hDiillEvLGcVM6aNDv jg2hyzmuzxqiEUrr1hDr2hFtLcD5hhoyAnbbplUggWrpk8axwRa5rFSAzriHn2mu0UORF0tNHUG St9yirJPpMVekNHIOsqJTfuzafUlZfwzY4tz72wlE2T6w+EKS1MMAsYte+k+7pzmYDKuNTb6HHV rzLa6zgKrW+uNul5J8y+Qg64ur0bR1bjQc27JZrSuk8kzI+/2W6/6nS7vB1SvPbL5WM5/bCRVrx aahTr+Rg0JDCSldHLSKOSQ4mbFvJFneyUnsRlEd4WrEGNBzBzLYZ/CuqP3A2UNMoUaAVS4Me1Xd NoPs417fSlc9Xu7lCqp7iFx01KI1tQ07uiHbunVdTpf+E7YTsYFTLVyIbBT8ueL0tdRtheyt7oM C3CCP/dgA/Ghuxw== X-Developer-Key: i=jacopo.mondi@ideasonboard.com; a=openpgp; fpr=72392EDC88144A65C701EA9BA5826A2587AD026B 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 only left user of fh2id() and remove the macro completely. Signed-off-by: Jacopo Mondi --- drivers/media/pci/ivtv/ivtv-driver.h | 5 -- drivers/media/pci/ivtv/ivtv-fileops.c | 2 +- drivers/media/pci/ivtv/ivtv-ioctl.c | 124 +++++++++++++++++-------------= ---- 3 files changed, 63 insertions(+), 68 deletions(-) diff --git a/drivers/media/pci/ivtv/ivtv-driver.h b/drivers/media/pci/ivtv/= ivtv-driver.h index 38c4ceb04cf834906ed877b57c20fcbdb390da13..69c37f450c21f91abb4e4f73823= 097bd61d5abc2 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.h +++ b/drivers/media/pci/ivtv/ivtv-driver.h @@ -384,11 +384,6 @@ struct ivtv_open_id { struct ivtv *itv; }; =20 -static inline struct ivtv_open_id *fh2id(struct v4l2_fh *fh) -{ - return container_of(fh, struct ivtv_open_id, fh); -} - static inline struct ivtv_open_id *file2id(struct file *filp) { return container_of(file_to_v4l2_fh(filp), struct ivtv_open_id, fh); diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv= /ivtv-fileops.c index 0040a5e7f654149eb429400dd1db7197a9a3b54e..814fe7989cdc11ed225f03a9168= be50c6b9ba595 100644 --- a/drivers/media/pci/ivtv/ivtv-fileops.c +++ b/drivers/media/pci/ivtv/ivtv-fileops.c @@ -878,7 +878,7 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id,= int flags, u64 pts) int ivtv_v4l2_close(struct file *filp) { struct v4l2_fh *fh =3D file_to_v4l2_fh(filp); - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(filp); struct ivtv *itv =3D id->itv; struct ivtv_stream *s =3D &itv->streams[id->type]; =20 diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/i= vtv-ioctl.c index d888435b71fb6f6873d9d884248a67364576bf33..8077a71d4850ec773caa20c3fca= 08f92f3117d69 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -308,7 +308,7 @@ static int ivtv_video_command(struct ivtv *itv, struct = ivtv_open_id *id, =20 static int ivtv_g_fmt_sliced_vbi_out(struct file *file, void *fh, struct v= 4l2_format *fmt) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; struct v4l2_sliced_vbi_format *vbifmt =3D &fmt->fmt.sliced; =20 vbifmt->reserved[0] =3D 0; @@ -330,7 +330,7 @@ static int ivtv_g_fmt_sliced_vbi_out(struct file *file,= void *fh, struct v4l2_fo =20 static int ivtv_g_fmt_vid_cap(struct file *file, void *fh, struct v4l2_for= mat *fmt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; struct v4l2_pix_format *pixfmt =3D &fmt->fmt.pix; =20 @@ -353,7 +353,7 @@ static int ivtv_g_fmt_vid_cap(struct file *file, void *= fh, struct v4l2_format *f =20 static int ivtv_g_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_for= mat *fmt) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; struct v4l2_vbi_format *vbifmt =3D &fmt->fmt.vbi; =20 vbifmt->sampling_rate =3D 27000000; @@ -372,7 +372,7 @@ static int ivtv_g_fmt_vbi_cap(struct file *file, void *= fh, struct v4l2_format *f static int ivtv_g_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v= 4l2_format *fmt) { struct v4l2_sliced_vbi_format *vbifmt =3D &fmt->fmt.sliced; - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 vbifmt->reserved[0] =3D 0; @@ -394,7 +394,7 @@ static int ivtv_g_fmt_sliced_vbi_cap(struct file *file,= void *fh, struct v4l2_fo =20 static int ivtv_g_fmt_vid_out(struct file *file, void *fh, struct v4l2_for= mat *fmt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; struct v4l2_pix_format *pixfmt =3D &fmt->fmt.pix; =20 @@ -434,8 +434,8 @@ static int ivtv_g_fmt_vid_out(struct file *file, void *= fh, struct v4l2_format *f =20 static int ivtv_g_fmt_vid_out_overlay(struct file *file, void *fh, struct = v4l2_format *fmt) { - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; struct v4l2_window *winfmt =3D &fmt->fmt.win; =20 if (!(s->vdev.device_caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) @@ -461,7 +461,7 @@ static int ivtv_try_fmt_sliced_vbi_out(struct file *fil= e, void *fh, struct v4l2_ =20 static int ivtv_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_f= ormat *fmt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; int w =3D fmt->fmt.pix.width; int h =3D fmt->fmt.pix.height; @@ -490,7 +490,7 @@ static int ivtv_try_fmt_vbi_cap(struct file *file, void= *fh, struct v4l2_format static int ivtv_try_fmt_sliced_vbi_cap(struct file *file, void *fh, struct= v4l2_format *fmt) { struct v4l2_sliced_vbi_format *vbifmt =3D &fmt->fmt.sliced; - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 if (id->type =3D=3D IVTV_DEC_STREAM_TYPE_VBI) @@ -510,7 +510,7 @@ static int ivtv_try_fmt_sliced_vbi_cap(struct file *fil= e, void *fh, struct v4l2_ =20 static int ivtv_try_fmt_vid_out(struct file *file, void *fh, struct v4l2_f= ormat *fmt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); s32 w =3D fmt->fmt.pix.width; s32 h =3D fmt->fmt.pix.height; int field =3D fmt->fmt.pix.field; @@ -544,8 +544,8 @@ static int ivtv_try_fmt_vid_out(struct file *file, void= *fh, struct v4l2_format =20 static int ivtv_try_fmt_vid_out_overlay(struct file *file, void *fh, struc= t v4l2_format *fmt) { - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; u32 chromakey =3D fmt->fmt.win.chromakey; u8 global_alpha =3D fmt->fmt.win.global_alpha; =20 @@ -566,7 +566,7 @@ static int ivtv_s_fmt_sliced_vbi_out(struct file *file,= void *fh, struct v4l2_fo =20 static int ivtv_s_fmt_vid_cap(struct file *file, void *fh, struct v4l2_for= mat *fmt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; struct v4l2_subdev_format format =3D { .which =3D V4L2_SUBDEV_FORMAT_ACTIVE, @@ -597,7 +597,7 @@ static int ivtv_s_fmt_vid_cap(struct file *file, void *= fh, struct v4l2_format *f =20 static int ivtv_s_fmt_vbi_cap(struct file *file, void *fh, struct v4l2_for= mat *fmt) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (!ivtv_raw_vbi(itv) && atomic_read(&itv->capturing) > 0) return -EBUSY; @@ -610,7 +610,7 @@ static int ivtv_s_fmt_vbi_cap(struct file *file, void *= fh, struct v4l2_format *f static int ivtv_s_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v= 4l2_format *fmt) { struct v4l2_sliced_vbi_format *vbifmt =3D &fmt->fmt.sliced; - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; int ret =3D ivtv_try_fmt_sliced_vbi_cap(file, fh, fmt); =20 @@ -628,7 +628,7 @@ static int ivtv_s_fmt_sliced_vbi_cap(struct file *file,= void *fh, struct v4l2_fo =20 static int ivtv_s_fmt_vid_out(struct file *file, void *fh, struct v4l2_for= mat *fmt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; struct yuv_playback_info *yi =3D &itv->yuv_info; int ret =3D ivtv_try_fmt_vid_out(file, fh, fmt); @@ -673,7 +673,7 @@ static int ivtv_s_fmt_vid_out(struct file *file, void *= fh, struct v4l2_format *f =20 static int ivtv_s_fmt_vid_out_overlay(struct file *file, void *fh, struct = v4l2_format *fmt) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; int ret =3D ivtv_try_fmt_vid_out_overlay(file, fh, fmt); =20 if (ret =3D=3D 0) { @@ -710,7 +710,7 @@ static int ivtv_itvc(struct ivtv *itv, bool get, u64 re= g, u64 *val) =20 static int ivtv_g_register(struct file *file, void *fh, struct v4l2_dbg_re= gister *reg) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 reg->size =3D 4; return ivtv_itvc(itv, true, reg->reg, ®->val); @@ -718,7 +718,7 @@ static int ivtv_g_register(struct file *file, void *fh,= struct v4l2_dbg_register =20 static int ivtv_s_register(struct file *file, void *fh, const struct v4l2_= dbg_register *reg) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; u64 val =3D reg->val; =20 return ivtv_itvc(itv, false, reg->reg, &val); @@ -727,7 +727,7 @@ static int ivtv_s_register(struct file *file, void *fh,= const struct v4l2_dbg_re =20 static int ivtv_querycap(struct file *file, void *fh, struct v4l2_capabili= ty *vcap) { - struct ivtv_open_id *id =3D fh2id(file_to_v4l2_fh(file)); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 strscpy(vcap->driver, IVTV_DRIVER_NAME, sizeof(vcap->driver)); @@ -738,14 +738,14 @@ static int ivtv_querycap(struct file *file, void *fh,= struct v4l2_capability *vc =20 static int ivtv_enumaudio(struct file *file, void *fh, struct v4l2_audio *= vin) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 return ivtv_get_audio_input(itv, vin->index, vin); } =20 static int ivtv_g_audio(struct file *file, void *fh, struct v4l2_audio *vi= n) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 vin->index =3D itv->audio_input; return ivtv_get_audio_input(itv, vin->index, vin); @@ -753,7 +753,7 @@ static int ivtv_g_audio(struct file *file, void *fh, st= ruct v4l2_audio *vin) =20 static int ivtv_s_audio(struct file *file, void *fh, const struct v4l2_aud= io *vout) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (vout->index >=3D itv->nof_audio_inputs) return -EINVAL; @@ -766,7 +766,7 @@ static int ivtv_s_audio(struct file *file, void *fh, co= nst struct v4l2_audio *vo =20 static int ivtv_enumaudout(struct file *file, void *fh, struct v4l2_audioo= ut *vin) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 /* set it to defaults from our table */ return ivtv_get_audio_output(itv, vin->index, vin); @@ -774,7 +774,7 @@ static int ivtv_enumaudout(struct file *file, void *fh,= struct v4l2_audioout *vi =20 static int ivtv_g_audout(struct file *file, void *fh, struct v4l2_audioout= *vin) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 vin->index =3D 0; return ivtv_get_audio_output(itv, vin->index, vin); @@ -782,7 +782,7 @@ static int ivtv_g_audout(struct file *file, void *fh, s= truct v4l2_audioout *vin) =20 static int ivtv_s_audout(struct file *file, void *fh, const struct v4l2_au= dioout *vout) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (itv->card->video_outputs =3D=3D NULL || vout->index !=3D 0) return -EINVAL; @@ -791,7 +791,7 @@ static int ivtv_s_audout(struct file *file, void *fh, c= onst struct v4l2_audioout =20 static int ivtv_enum_input(struct file *file, void *fh, struct v4l2_input = *vin) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 /* set it to defaults from our table */ return ivtv_get_input(itv, vin->index, vin); @@ -799,7 +799,7 @@ static int ivtv_enum_input(struct file *file, void *fh,= struct v4l2_input *vin) =20 static int ivtv_enum_output(struct file *file, void *fh, struct v4l2_outpu= t *vout) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 return ivtv_get_output(itv, vout->index, vout); } @@ -807,7 +807,7 @@ static int ivtv_enum_output(struct file *file, void *fh= , struct v4l2_output *vou static int ivtv_g_pixelaspect(struct file *file, void *fh, int type, struct v4l2_fract *f) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 if (type =3D=3D V4L2_BUF_TYPE_VIDEO_CAPTURE) { @@ -825,7 +825,7 @@ static int ivtv_g_pixelaspect(struct file *file, void *= fh, static int ivtv_s_selection(struct file *file, void *fh, struct v4l2_selection *sel) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; struct yuv_playback_info *yi =3D &itv->yuv_info; struct v4l2_rect r =3D { 0, 0, 720, 0 }; @@ -868,7 +868,7 @@ static int ivtv_s_selection(struct file *file, void *fh, static int ivtv_g_selection(struct file *file, void *fh, struct v4l2_selection *sel) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; struct yuv_playback_info *yi =3D &itv->yuv_info; struct v4l2_rect r =3D { 0, 0, 720, 0 }; @@ -924,8 +924,8 @@ static int ivtv_enum_fmt_vid_cap(struct file *file, voi= d *fh, struct v4l2_fmtdes .description =3D "MPEG", .pixelformat =3D V4L2_PIX_FMT_MPEG, }; - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; =20 if (fmt->index) return -EINVAL; @@ -951,8 +951,8 @@ static int ivtv_enum_fmt_vid_out(struct file *file, voi= d *fh, struct v4l2_fmtdes .description =3D "MPEG", .pixelformat =3D V4L2_PIX_FMT_MPEG, }; - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; =20 if (fmt->index) return -EINVAL; @@ -967,7 +967,7 @@ static int ivtv_enum_fmt_vid_out(struct file *file, voi= d *fh, struct v4l2_fmtdes =20 static int ivtv_g_input(struct file *file, void *fh, unsigned int *i) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 *i =3D itv->active_input; =20 @@ -976,7 +976,7 @@ static int ivtv_g_input(struct file *file, void *fh, un= signed int *i) =20 int ivtv_s_input(struct file *file, void *fh, unsigned int inp) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; v4l2_std_id std; int i; =20 @@ -1019,7 +1019,7 @@ int ivtv_s_input(struct file *file, void *fh, unsigne= d int inp) =20 static int ivtv_g_output(struct file *file, void *fh, unsigned int *i) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) return -EINVAL; @@ -1031,7 +1031,7 @@ static int ivtv_g_output(struct file *file, void *fh,= unsigned int *i) =20 static int ivtv_s_output(struct file *file, void *fh, unsigned int outp) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (outp >=3D itv->card->nof_outputs) return -EINVAL; @@ -1053,8 +1053,8 @@ static int ivtv_s_output(struct file *file, void *fh,= unsigned int outp) =20 static int ivtv_g_frequency(struct file *file, void *fh, struct v4l2_frequ= ency *vf) { - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; =20 if (s->vdev.vfl_dir) return -ENOTTY; @@ -1067,8 +1067,8 @@ static int ivtv_g_frequency(struct file *file, void *= fh, struct v4l2_frequency * =20 int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_freque= ncy *vf) { - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; =20 if (s->vdev.vfl_dir) return -ENOTTY; @@ -1084,7 +1084,7 @@ int ivtv_s_frequency(struct file *file, void *fh, con= st struct v4l2_frequency *v =20 static int ivtv_g_std(struct file *file, void *fh, v4l2_std_id *std) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 *std =3D itv->std; return 0; @@ -1157,7 +1157,7 @@ void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std) =20 static int ivtv_s_std(struct file *file, void *fh, v4l2_std_id std) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if ((std & V4L2_STD_ALL) =3D=3D 0) return -EINVAL; @@ -1185,7 +1185,7 @@ static int ivtv_s_std(struct file *file, void *fh, v4= l2_std_id std) =20 static int ivtv_s_tuner(struct file *file, void *fh, const struct v4l2_tun= er *vt) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 if (vt->index !=3D 0) @@ -1198,7 +1198,7 @@ static int ivtv_s_tuner(struct file *file, void *fh, = const struct v4l2_tuner *vt =20 static int ivtv_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (vt->index !=3D 0) return -EINVAL; @@ -1214,7 +1214,7 @@ static int ivtv_g_tuner(struct file *file, void *fh, = struct v4l2_tuner *vt) =20 static int ivtv_g_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_= sliced_vbi_cap *cap) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; int set =3D itv->is_50hz ? V4L2_SLICED_VBI_625 : V4L2_SLICED_VBI_525; int f, l; =20 @@ -1249,7 +1249,7 @@ static int ivtv_g_sliced_vbi_cap(struct file *file, v= oid *fh, struct v4l2_sliced =20 static int ivtv_g_enc_index(struct file *file, void *fh, struct v4l2_enc_i= dx *idx) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; struct v4l2_enc_idx_entry *e =3D idx->entry; int entries; int i; @@ -1275,7 +1275,7 @@ static int ivtv_g_enc_index(struct file *file, void *= fh, struct v4l2_enc_idx *id =20 static int ivtv_encoder_cmd(struct file *file, void *fh, struct v4l2_encod= er_cmd *enc) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 =20 @@ -1327,7 +1327,7 @@ static int ivtv_encoder_cmd(struct file *file, void *= fh, struct v4l2_encoder_cmd =20 static int ivtv_try_encoder_cmd(struct file *file, void *fh, struct v4l2_e= ncoder_cmd *enc) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 switch (enc->cmd) { case V4L2_ENC_CMD_START: @@ -1357,8 +1357,8 @@ static int ivtv_try_encoder_cmd(struct file *file, vo= id *fh, struct v4l2_encoder =20 static int ivtv_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffe= r *fb) { - struct ivtv *itv =3D fh2id(fh)->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv *itv =3D file2id(file)->itv; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; u32 data[CX2341X_MBOX_MAX_DATA]; struct yuv_playback_info *yi =3D &itv->yuv_info; =20 @@ -1444,9 +1444,9 @@ static int ivtv_g_fbuf(struct file *file, void *fh, s= truct v4l2_framebuffer *fb) =20 static int ivtv_s_fbuf(struct file *file, void *fh, const struct v4l2_fram= ebuffer *fb) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; struct yuv_playback_info *yi =3D &itv->yuv_info; =20 if (!(s->vdev.device_caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) @@ -1465,9 +1465,9 @@ static int ivtv_s_fbuf(struct file *file, void *fh, c= onst struct v4l2_framebuffe =20 static int ivtv_overlay(struct file *file, void *fh, unsigned int on) { - struct ivtv_open_id *id =3D fh2id(fh); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; - struct ivtv_stream *s =3D &itv->streams[fh2id(fh)->type]; + struct ivtv_stream *s =3D &itv->streams[file2id(file)->type]; =20 if (!(s->vdev.device_caps & V4L2_CAP_VIDEO_OUTPUT_OVERLAY)) return -ENOTTY; @@ -1492,7 +1492,7 @@ static int ivtv_subscribe_event(struct v4l2_fh *fh, c= onst struct v4l2_event_subs =20 static int ivtv_log_status(struct file *file, void *fh) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; u32 data[CX2341X_MBOX_MAX_DATA]; =20 int has_output =3D itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT; @@ -1584,7 +1584,7 @@ static int ivtv_log_status(struct file *file, void *f= h) =20 static int ivtv_decoder_cmd(struct file *file, void *fh, struct v4l2_decod= er_cmd *dec) { - struct ivtv_open_id *id =3D fh2id(file_to_v4l2_fh(file)); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 IVTV_DEBUG_IOCTL("VIDIOC_DECODER_CMD %d\n", dec->cmd); @@ -1593,7 +1593,7 @@ static int ivtv_decoder_cmd(struct file *file, void *= fh, struct v4l2_decoder_cmd =20 static int ivtv_try_decoder_cmd(struct file *file, void *fh, struct v4l2_d= ecoder_cmd *dec) { - struct ivtv_open_id *id =3D fh2id(file_to_v4l2_fh(file)); + struct ivtv_open_id *id =3D file2id(file); struct ivtv *itv =3D id->itv; =20 IVTV_DEBUG_IOCTL("VIDIOC_TRY_DECODER_CMD %d\n", dec->cmd); @@ -1602,7 +1602,7 @@ static int ivtv_try_decoder_cmd(struct file *file, vo= id *fh, struct v4l2_decoder =20 static int ivtv_decoder_ioctls(struct file *filp, unsigned int cmd, void *= arg) { - struct ivtv_open_id *id =3D fh2id(file_to_v4l2_fh(filp)); + struct ivtv_open_id *id =3D file2id(filp); struct ivtv *itv =3D id->itv; struct ivtv_stream *s =3D &itv->streams[id->type]; =20 @@ -1645,7 +1645,7 @@ static int ivtv_decoder_ioctls(struct file *filp, uns= igned int cmd, void *arg) static long ivtv_default(struct file *file, void *fh, bool valid_prio, unsigned int cmd, void *arg) { - struct ivtv *itv =3D fh2id(fh)->itv; + struct ivtv *itv =3D file2id(file)->itv; =20 if (!valid_prio) { switch (cmd) { --=20 2.49.0