]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: Reset file->private_data to NULL in v4l2_fh_del()
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 10 Aug 2025 01:30:09 +0000 (04:30 +0300)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 13 Aug 2025 06:33:44 +0000 (08:33 +0200)
Multiple drivers that use v4l2_fh and call v4l2_fh_del() manually reset
the file->private_data pointer to NULL in their video device .release()
file operation handler. Move the code to the v4l2_fh_del() function to
avoid direct access to file->private_data in drivers. This requires
adding a file pointer argument to the function.

Changes to drivers have been generated with the following coccinelle
semantic patch:

@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
<...
- filp->private_data = NULL;
...
- v4l2_fh_del(fh);
+ v4l2_fh_del(fh, filp);
...>
}

@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
<...
- v4l2_fh_del(fh);
+ v4l2_fh_del(fh, filp);
...
- filp->private_data = NULL;
...>
}

@@
expression fh;
identifier filp;
identifier release;
type ret;
@@
ret release(..., struct file *filp, ...)
{
<...
- v4l2_fh_del(fh);
+ v4l2_fh_del(fh, filp);
...>
}

Manual changes have been applied to Documentation/ to update the usage
patterns, to drivers/media/v4l2-core/v4l2-fh.c to update the
v4l2_fh_del() prototype and reset file->private_data, and to
include/media/v4l2-fh.h to update the v4l2_fh_del() function prototype
and its documentation.

Additionally, white space issues have been fixed manually in
drivers/usb/gadget/function/uvc_v4l2.c

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
57 files changed:
Documentation/driver-api/media/v4l2-fh.rst
Documentation/translations/zh_CN/video4linux/v4l2-framework.txt
drivers/media/pci/cx18/cx18-fileops.c
drivers/media/pci/ivtv/ivtv-fileops.c
drivers/media/pci/saa7164/saa7164-encoder.c
drivers/media/pci/saa7164/saa7164-vbi.c
drivers/media/platform/allegro-dvt/allegro-core.c
drivers/media/platform/amlogic/meson-ge2d/ge2d.c
drivers/media/platform/amphion/vpu_v4l2.c
drivers/media/platform/chips-media/coda/coda-common.c
drivers/media/platform/chips-media/wave5/wave5-helper.c
drivers/media/platform/imagination/e5010-jpeg-enc.c
drivers/media/platform/m2m-deinterlace.c
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c
drivers/media/platform/mediatek/mdp/mtk_mdp_m2m.c
drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c
drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec_drv.c
drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc_drv.c
drivers/media/platform/nvidia/tegra-vde/v4l2.c
drivers/media/platform/nxp/dw100/dw100.c
drivers/media/platform/nxp/imx-jpeg/mxc-jpeg.c
drivers/media/platform/nxp/imx-pxp.c
drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
drivers/media/platform/nxp/mx2_emmaprp.c
drivers/media/platform/qcom/iris/iris_vidc.c
drivers/media/platform/qcom/venus/core.c
drivers/media/platform/renesas/rcar_fdp1.c
drivers/media/platform/renesas/rcar_jpu.c
drivers/media/platform/renesas/vsp1/vsp1_video.c
drivers/media/platform/rockchip/rga/rga.c
drivers/media/platform/rockchip/rkvdec/rkvdec.c
drivers/media/platform/samsung/exynos-gsc/gsc-m2m.c
drivers/media/platform/samsung/exynos4-is/fimc-m2m.c
drivers/media/platform/samsung/s5p-g2d/g2d.c
drivers/media/platform/samsung/s5p-jpeg/jpeg-core.c
drivers/media/platform/samsung/s5p-mfc/s5p_mfc.c
drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c
drivers/media/platform/st/sti/delta/delta-v4l2.c
drivers/media/platform/st/sti/hva/hva-v4l2.c
drivers/media/platform/st/stm32/dma2d/dma2d.c
drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c
drivers/media/platform/ti/omap3isp/ispvideo.c
drivers/media/platform/ti/vpe/vpe.c
drivers/media/platform/verisilicon/hantro_drv.c
drivers/media/test-drivers/vicodec/vicodec-core.c
drivers/media/test-drivers/vim2m.c
drivers/media/test-drivers/visl/visl-core.c
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
drivers/media/v4l2-core/v4l2-fh.c
drivers/media/v4l2-core/v4l2-subdev.c
drivers/staging/media/imx/imx-media-csc-scaler.c
drivers/staging/media/meson/vdec/vdec.c
drivers/staging/media/sunxi/cedrus/cedrus.c
drivers/staging/most/video/video.c
drivers/usb/gadget/function/uvc_v4l2.c
include/media/v4l2-fh.h

index a7393067f5db2183aa677e15ece512296455e23b..afcad22ead7c919a07475720058ec1ab3a5d5494 100644 (file)
@@ -65,7 +65,7 @@ Example:
                struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
 
                ...
-               v4l2_fh_del(&my_fh->fh);
+               v4l2_fh_del(&my_fh->fh, file);
                v4l2_fh_exit(&my_fh->fh);
                kfree(my_fh);
                return 0;
@@ -86,7 +86,7 @@ Below is a short description of the :c:type:`v4l2_fh` functions used:
   Must be called once the file handle is completely initialized.
 
 :c:func:`v4l2_fh_del <v4l2_fh_del>`
-(:c:type:`fh <v4l2_fh>`)
+(:c:type:`fh <v4l2_fh>`, struct file \*filp)
 
 - Unassociate the file handle from :c:type:`video_device`. The file handle
   exit function may now be called.
index 2d38ae17d9404d9d40c63bc8329f3cc6999b7a11..1653c6e2cb4659c71bdb5001a0a3ba0b1c3c9411 100644 (file)
@@ -822,7 +822,7 @@ int my_release(struct file *file)
        struct my_fh *my_fh = container_of(fh, struct my_fh, fh);
 
        ...
-       v4l2_fh_del(&my_fh->fh);
+       v4l2_fh_del(&my_fh->fh, file);
        v4l2_fh_exit(&my_fh->fh);
        kfree(my_fh);
        return 0;
@@ -840,7 +840,7 @@ void v4l2_fh_add(struct v4l2_fh *fh, struct file *filp)
   添加一个 v4l2_fh 到 video_device 文件句柄列表。一旦文件句柄
   初始化完成就必须调用。
 
-void v4l2_fh_del(struct v4l2_fh *fh)
+void v4l2_fh_del(struct v4l2_fh *fh, struct file *filp)
 
   从 video_device() 中解除文件句柄的关联。文件句柄的退出函数也
   将被调用。
index f90b547f5d676308ed5c7956a8da02e208b9446e..d49fa4c4119b6e14843a01a73c9662839ecc6c05 100644 (file)
@@ -713,7 +713,7 @@ int cx18_v4l2_close(struct file *filp)
                vb2_queue_release(vdev->queue);
                vdev->queue->owner = NULL;
        }
-       v4l2_fh_del(fh);
+       v4l2_fh_del(fh, filp);
        v4l2_fh_exit(fh);
 
        /* 'Unclaim' this stream */
@@ -751,7 +751,7 @@ static int cx18_serialized_open(struct cx18_stream *s, struct file *filp)
                        if (atomic_read(&cx->ana_capturing) > 0) {
                                /* switching to radio while capture is
                                   in progress is not polite */
-                               v4l2_fh_del(&item->fh);
+                               v4l2_fh_del(&item->fh, filp);
                                v4l2_fh_exit(&item->fh);
                                kfree(item);
                                return -EBUSY;
index aa5f5f16427c48123cd314932a7d8bc48f07c031..0040a5e7f654149eb429400dd1db7197a9a3b54e 100644 (file)
@@ -911,7 +911,7 @@ int ivtv_v4l2_close(struct file *filp)
                ivtv_unmute(itv);
        }
 
-       v4l2_fh_del(fh);
+       v4l2_fh_del(fh, filp);
        v4l2_fh_exit(fh);
 
        /* Easy case first: this stream was never claimed by us */
@@ -1006,7 +1006,7 @@ static int ivtv_open(struct file *filp)
                        if (atomic_read(&itv->capturing) > 0) {
                                /* switching to radio while capture is
                                   in progress is not polite */
-                               v4l2_fh_del(&item->fh);
+                               v4l2_fh_del(&item->fh, filp);
                                v4l2_fh_exit(&item->fh);
                                kfree(item);
                                return -EBUSY;
index e6e353a251cf548525c44e87695f7d45bde302a6..66d650b5f69af1eac9117b9c65ac7c39883f6f21 100644 (file)
@@ -746,7 +746,7 @@ static int fops_release(struct file *file)
                }
        }
 
-       v4l2_fh_del(&fh->fh);
+       v4l2_fh_del(&fh->fh, file);
        v4l2_fh_exit(&fh->fh);
        kfree(fh);
 
index 181442fcb43b08cd96f29c2357bcfadd3ddcedb4..57e4362c0d19d0d3a5f0be1ee58cd141fdf62462 100644 (file)
@@ -449,7 +449,7 @@ static int fops_release(struct file *file)
                }
        }
 
-       v4l2_fh_del(&fh->fh);
+       v4l2_fh_del(&fh->fh, file);
        v4l2_fh_exit(&fh->fh);
        kfree(fh);
 
index 8c30f3cd4fc545133f697973b0f002ea888a3a4a..5e3b1f5d7206d84b8ccb9ea3b3f3f1fe75becf99 100644 (file)
@@ -3241,7 +3241,7 @@ static int allegro_release(struct file *file)
 
        v4l2_ctrl_handler_free(&channel->ctrl_handler);
 
-       v4l2_fh_del(&channel->fh);
+       v4l2_fh_del(&channel->fh, file);
        v4l2_fh_exit(&channel->fh);
 
        kfree(channel);
index d36891b546bca417e8b98c5e0458ebb15e24c213..b1b0b6535fb1931c74ae9b2da28bea579cd1bc4c 100644 (file)
@@ -883,7 +883,7 @@ static int ge2d_release(struct file *file)
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 
index e13bfe09af1bf0926bf6005b83a8aae7e34a2122..fcb2eff813ac456386ef163c53db8ac34a278dd7 100644 (file)
@@ -791,7 +791,7 @@ int vpu_v4l2_open(struct file *file, struct vpu_inst *inst)
 
        return 0;
 error:
-       v4l2_fh_del(&inst->fh);
+       v4l2_fh_del(&inst->fh, file);
        v4l2_fh_exit(&inst->fh);
        vpu_inst_put(inst);
        return ret;
@@ -812,7 +812,7 @@ int vpu_v4l2_close(struct file *file)
        call_void_vop(inst, release);
        vpu_inst_unlock(inst);
 
-       v4l2_fh_del(&inst->fh);
+       v4l2_fh_del(&inst->fh, file);
        v4l2_fh_exit(&inst->fh);
 
        vpu_inst_unregister(inst);
index 7d874fd502b86a6b6137ecd279d6866cd715598b..583759eed610f8eba835adb938c10610dcd8ba7f 100644 (file)
@@ -2725,7 +2725,7 @@ err_clk_ahb:
 err_clk_enable:
        pm_runtime_put_sync(dev->dev);
 err_pm_get:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 err_coda_name_init:
        ida_free(&dev->ida, ctx->idx);
@@ -2763,7 +2763,7 @@ static int coda_release(struct file *file)
        clk_disable_unprepare(dev->clk_ahb);
        clk_disable_unprepare(dev->clk_per);
        pm_runtime_put_sync(dev->dev);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        ida_free(&dev->ida, ctx->idx);
        if (ctx->ops->release)
index ed8ff04a899da0a3c9e0f037dac2c9548c98920f..0bce62f0c03902ae367182ee04774c79accc4712 100644 (file)
@@ -46,7 +46,7 @@ void wave5_cleanup_instance(struct vpu_instance *inst, struct file *filp)
        wave5_vdi_free_dma_memory(inst->dev, &inst->bitstream_vbuf);
        v4l2_ctrl_handler_free(&inst->v4l2_ctrl_hdl);
        if (inst->v4l2_fh.vdev) {
-               v4l2_fh_del(&inst->v4l2_fh);
+               v4l2_fh_del(&inst->v4l2_fh, filp);
                v4l2_fh_exit(&inst->v4l2_fh);
        }
        list_del_init(&inst->list);
index 1da00ff4b1e36a6486ce54e02139f6489d6acf22..c4e0097cb8b7fa310c2c5519d7af4e6e3b378915 100644 (file)
@@ -769,7 +769,7 @@ static int e5010_open(struct file *file)
 err_ctrls_setup:
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 exit:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        mutex_unlock(&e5010->mutex);
 free:
@@ -786,7 +786,7 @@ static int e5010_release(struct file *file)
        mutex_lock(&e5010->mutex);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        mutex_unlock(&e5010->mutex);
index a343dffd19f03c68557415afae2a8db4b3614d2e..51c2f206cb1f601ec2f3d07fffbf63c86f4cdc01 100644 (file)
@@ -880,7 +880,7 @@ static int deinterlace_release(struct file *file)
 
        dprintk(pcdev, "Releasing instance %p\n", ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        kfree(ctx->xt);
index 5178a1b170fe3215b6aaf540d6107886fde86a64..de15d6f0b490c60efb7fcf7dd14049979b751943 100644 (file)
@@ -1201,7 +1201,7 @@ static int mtk_jpeg_open(struct file *file)
        return 0;
 
 error:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        mutex_unlock(&jpeg->lock);
 free:
@@ -1217,7 +1217,7 @@ static int mtk_jpeg_release(struct file *file)
        mutex_lock(&jpeg->lock);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        mutex_unlock(&jpeg->lock);
index 7a1a8e51dbca35525887272c30efeb78ea4f31b3..7e89a8443707d82ba7f90c14c3ea41cbe039aa23 100644 (file)
@@ -1130,7 +1130,7 @@ err_load_vpu:
 error_m2m_ctx:
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
 error_ctrls:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        mutex_unlock(&mdp->lock);
 err_lock:
@@ -1148,7 +1148,7 @@ static int mtk_mdp_m2m_release(struct file *file)
        mutex_lock(&mdp->lock);
        v4l2_m2m_ctx_release(ctx->m2m_ctx);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        mtk_mdp_vpu_deinit(&ctx->vpu);
        mdp->ctx_num--;
index 847d6b310e74e2dada48f0b8ec94b9c76445c052..e68ae19d71a9c39ff2aa24c7b059a57a3322ed15 100644 (file)
@@ -633,7 +633,7 @@ err_release_m2m_ctx:
        v4l2_m2m_ctx_release(ctx->m2m_ctx);
 err_release_handler:
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
 err_exit_fh:
        v4l2_fh_exit(&ctx->fh);
        ida_free(&mdp->mdp_ida, ctx->id);
@@ -657,7 +657,7 @@ static int mdp_m2m_release(struct file *file)
                mdp_vpu_put_locked(mdp);
 
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        ida_free(&mdp->mdp_ida, ctx->id);
        mutex_unlock(&mdp->m2m_lock);
index 952a77c383bdb8dba94c74916674e729ee5aba35..46d176e6de63e370693fe20cc04c52cde81f4d73 100644 (file)
@@ -282,7 +282,7 @@ err_load_fw:
 err_m2m_ctx_init:
        v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
 err_ctrls_setup:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        mutex_unlock(&dev->dev_mutex);
@@ -307,7 +307,7 @@ static int fops_vcodec_release(struct file *file)
        v4l2_m2m_ctx_release(ctx->m2m_ctx);
        mtk_vcodec_dec_release(ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
 
index 9cacb6cbcf28357826db2df7e15c3588e7b4d4c8..fb1c3bdc2daeb4b439d29bb6bbecc1ad786e9eb0 100644 (file)
@@ -191,7 +191,7 @@ err_load_fw:
 err_m2m_ctx_init:
        v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
 err_ctrls_setup:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        mutex_unlock(&dev->dev_mutex);
@@ -209,7 +209,7 @@ static int fops_vcodec_release(struct file *file)
 
        v4l2_m2m_ctx_release(ctx->m2m_ctx);
        mtk_vcodec_enc_release(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
 
index 688b776b30107df4ec3642a4bc0e896759ccf0fe..0c50f4ff82e0a8f4935325d00691c58072182926 100644 (file)
@@ -856,7 +856,7 @@ static int tegra_release(struct file *file)
        struct tegra_ctx *ctx = fh_to_tegra_ctx(fh);
        struct tegra_vde *vde = ctx->vde;
 
-       v4l2_fh_del(fh);
+       v4l2_fh_del(fh, file);
        v4l2_m2m_ctx_release(fh->m2m_ctx);
        v4l2_ctrl_handler_free(&ctx->hdl);
        v4l2_fh_exit(fh);
index 2bd30910ddf98401dfc9d8f2e3b19fe8672320e3..97744c7b7c034cadfdd3f6d76165b4da85fa3d16 100644 (file)
@@ -667,7 +667,7 @@ static int dw100_release(struct file *file)
 {
        struct dw100_ctx *ctx = dw100_file2ctx(file);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
index d7cecc56a9eb56e521748b412bb5fc15b505d30a..a34e644b2cb1bb340b334a47d9214ba4119d9328 100644 (file)
@@ -2238,7 +2238,7 @@ static int mxc_jpeg_open(struct file *file)
 err_ctrls_setup:
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 error:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        mutex_unlock(&mxc_jpeg->lock);
 free:
@@ -2751,7 +2751,7 @@ static int mxc_jpeg_release(struct file *file)
                        ctx->slot);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        mutex_unlock(&mxc_jpeg->lock);
index 9602409f3ecef7e2a77a58f9c3376823a72ec551..6cc9b07ea53a002c2eda0fd6062096f5527ad62c 100644 (file)
@@ -1716,7 +1716,7 @@ static int pxp_release(struct file *file)
 
        dprintk(dev, "Releasing instance %p\n", ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        mutex_lock(&dev->dev_mutex);
index d6df6e2725f58ed4875d0d87bca5193cf59915fa..31298307c672d4b7fbb23d77d8c7199f111c771b 100644 (file)
@@ -716,7 +716,7 @@ static int mxc_isi_m2m_release(struct file *file)
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        mxc_isi_m2m_ctx_ctrls_delete(ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 
        mutex_destroy(&ctx->vb2_lock);
index 8c8f834e6250f5effcbb7f098f388a9ccc96302c..d23da93304bd6f55898cfb96319d2fa101036ca1 100644 (file)
@@ -769,7 +769,7 @@ static int emmaprp_release(struct file *file)
        mutex_lock(&pcdev->dev_mutex);
        clk_disable_unprepare(pcdev->clk_emma_ahb);
        clk_disable_unprepare(pcdev->clk_emma_ipg);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        mutex_unlock(&pcdev->dev_mutex);
index cdd34a3b71ff4309829f0f159241c3815658bcb8..541ae86f7892ab7ca89e9d5856ef10d189b2fb32 100644 (file)
@@ -30,8 +30,7 @@ static void iris_v4l2_fh_init(struct iris_inst *inst, struct file *filp)
 
 static void iris_v4l2_fh_deinit(struct iris_inst *inst, struct file *filp)
 {
-       filp->private_data = NULL;
-       v4l2_fh_del(&inst->fh);
+       v4l2_fh_del(&inst->fh, filp);
        inst->fh.ctrl_handler = NULL;
        v4l2_fh_exit(&inst->fh);
 }
index 5e1ace16a4903999c7fd7a985317dae8dd2410ba..90de29f166ada7aa5afe611041df308b5dfe8312 100644 (file)
@@ -607,7 +607,7 @@ void venus_close_common(struct venus_inst *inst, struct file *filp)
        v4l2_m2m_ctx_release(inst->m2m_ctx);
        v4l2_m2m_release(inst->m2m_dev);
        hfi_session_destroy(inst);
-       v4l2_fh_del(&inst->fh);
+       v4l2_fh_del(&inst->fh, filp);
        v4l2_fh_exit(&inst->fh);
        v4l2_ctrl_handler_free(&inst->ctrl_handler);
 
index f1ea303ac0380d30996bc46015d3f5d43f2516f2..e2dba0e4f3158d57996466c2222e2c697ba27e40 100644 (file)
@@ -2166,7 +2166,7 @@ static int fdp1_release(struct file *file)
 
        dprintk(fdp1, "Releasing instance %p\n", ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        mutex_lock(&fdp1->dev_mutex);
index d0d4ee3f8bdc8b15c7ad5a23a227f10a5e534cc5..0b479dfa29174c6616c20e94d40fd2a8c3cec39a 100644 (file)
@@ -1276,7 +1276,7 @@ jpu_reset_rollback:
 device_prepare_rollback:
        mutex_unlock(&jpu->mutex);
 v4l_prepare_rollback:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        return ret;
@@ -1289,7 +1289,7 @@ static int jpu_release(struct file *file)
 
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 
index b6dc1ee3dc50ac8d0eb79408b06c601cb501e9b8..75f9a1a85d558ff0afa2fdaf8c43a22ddbd694a8 100644 (file)
@@ -1083,7 +1083,7 @@ static int vsp1_video_open(struct file *file)
 
        ret = vsp1_device_get(video->vsp1);
        if (ret < 0) {
-               v4l2_fh_del(vfh);
+               v4l2_fh_del(vfh, file);
                v4l2_fh_exit(vfh);
                kfree(vfh);
        }
index d88817023996b29afc79cdd6fbdd42dfc5829b13..45c42c7ad846fab985e573ef7acf4a5bc1a4cac1 100644 (file)
@@ -418,7 +418,7 @@ static int rga_release(struct file *file)
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 
index 2fbad685e92cee4916420565a28c778b1a5e1a8e..481c2488f9ac64e70869ed21e5053cfbc4ed6e0e 100644 (file)
@@ -954,7 +954,7 @@ static int rkvdec_release(struct file *filp)
 {
        struct rkvdec_ctx *ctx = file_to_rkvdec_ctx(filp);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, filp);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
        v4l2_fh_exit(&ctx->fh);
index 39d84ffd1b05990ba4b8af281aba09e3f9cc5340..2999fb2610f0f61b63d0331f94883469ff43d751 100644 (file)
@@ -654,7 +654,7 @@ static int gsc_m2m_open(struct file *file)
 
 error_ctrls:
        gsc_ctrls_delete(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
 error_fh:
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
@@ -675,7 +675,7 @@ static int gsc_m2m_release(struct file *file)
 
        v4l2_m2m_ctx_release(ctx->m2m_ctx);
        gsc_ctrls_delete(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 
        if (--gsc->m2m.refcnt <= 0)
index b002b02a899efdd95df4ae8a5db59b9f144a61db..609fd84f89d4ad189d0f367bb37693f15f3a618e 100644 (file)
@@ -663,7 +663,7 @@ error_m2m_ctx:
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 error_c:
        fimc_ctrls_delete(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
 error_fh:
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
@@ -684,7 +684,7 @@ static int fimc_m2m_release(struct file *file)
 
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        fimc_ctrls_delete(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 
        if (--fimc->m2m.refcnt <= 0)
index e34cae9c9cf65d3161822b68233d28472171f917..922262f61e7b53baf1b5840d35149bf5b4b2e7ad 100644 (file)
@@ -280,7 +280,7 @@ static int g2d_release(struct file *file)
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        mutex_unlock(&dev->mutex);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        v4l2_info(&dev->v4l2_dev, "instance closed\n");
index 9e35dd939ad7a338b1f0971893b423ddcc4a1867..65f256db4c766ea17265018c76bafbd18948ccd6 100644 (file)
@@ -1005,7 +1005,7 @@ static int s5p_jpeg_open(struct file *file)
        return 0;
 
 error:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        mutex_unlock(&jpeg->lock);
 free:
@@ -1021,7 +1021,7 @@ static int s5p_jpeg_release(struct file *file)
        mutex_lock(&jpeg->lock);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        mutex_unlock(&jpeg->lock);
index 74629db05121ac9181af9daa471c113876f9d323..a5e756049620cdf35df4526b9a4cb55985f6476e 100644 (file)
@@ -955,7 +955,7 @@ err_ctrls_setup:
 err_bad_node:
        dev->ctx[ctx->num] = NULL;
 err_no_ctx:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 err_alloc:
@@ -1010,7 +1010,7 @@ static int s5p_mfc_release(struct file *file)
        if (dev)
                dev->ctx[ctx->num] = NULL;
        s5p_mfc_dec_ctrls_delete(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        /* vdev is gone if dev is null */
        if (dev)
                v4l2_fh_exit(&ctx->fh);
index 5e983799e298f1355af5a4acd94c970cec203cdb..38b2a292444392c79844cc5a0aa841cc73d8b48b 100644 (file)
@@ -634,7 +634,7 @@ static int bdisp_open(struct file *file)
 
 error_ctrls:
        bdisp_ctrls_delete(ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
 error_fh:
        v4l2_fh_exit(&ctx->fh);
        bdisp_hw_free_nodes(ctx);
@@ -659,7 +659,7 @@ static int bdisp_release(struct file *file)
 
        bdisp_ctrls_delete(ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 
        if (--bdisp->m2m.refcnt <= 0)
index 3063a98ed25b0942ba4aa28bbd23fe4b48f76d9a..385b26d2140854c4bae11db8f88283f9b33e9452 100644 (file)
@@ -1684,7 +1684,7 @@ static int delta_open(struct file *file)
        return 0;
 
 err_fh_del:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 err:
@@ -1712,7 +1712,7 @@ static int delta_release(struct file *file)
 
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 
        /* disable ST231 clocks */
index 2f9413fa7318f42b390f96447dcb1a905836703e..3581b73a99b8ba5702e5d4d8d02cd5c832fa1555 100644 (file)
@@ -1218,7 +1218,7 @@ static int hva_open(struct file *file)
 err_ctrls:
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
 err_fh:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 out:
@@ -1249,7 +1249,7 @@ static int hva_release(struct file *file)
 
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
 
 #ifdef CONFIG_VIDEO_STI_HVA_DEBUGFS
index b2bced06a1e603f7479620d5db3c12ee89e5149e..bc0f81e78018b20c38677eaea44358ddad7a9a52 100644 (file)
@@ -326,7 +326,7 @@ static int dma2d_release(struct file *file)
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        mutex_unlock(&dev->mutex);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 
index 7823eb97faf7e9bd13286ab14db2b436fc5caf1f..eb519afb30ca10c6f4370626d0dce9e7183b28e5 100644 (file)
@@ -759,7 +759,7 @@ static int deinterlace_release(struct file *file)
 
        mutex_lock(&dev->dev_mutex);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
index 368a858b8c0fdea462b85c8c71e22058d10a6c05..89992feaab6082b438eec189c0de93568d09f911 100644 (file)
@@ -695,7 +695,7 @@ static int rotate_release(struct file *file)
        mutex_lock(&dev->dev_mutex);
 
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
index d10a2b96c13cf1f5103504a8bd10c65111392a1e..2c0008444b7e2b532c9af061760e7399cdf3e45d 100644 (file)
@@ -1336,7 +1336,7 @@ static int isp_video_open(struct file *file)
 
 done:
        if (ret < 0) {
-               v4l2_fh_del(&handle->vfh);
+               v4l2_fh_del(&handle->vfh, file);
                v4l2_fh_exit(&handle->vfh);
                kfree(handle);
        }
@@ -1360,10 +1360,9 @@ static int isp_video_release(struct file *file)
        v4l2_pipeline_pm_put(&video->video.entity);
 
        /* Release the file handle. */
-       v4l2_fh_del(vfh);
+       v4l2_fh_del(vfh, file);
        v4l2_fh_exit(vfh);
        kfree(handle);
-       file->private_data = NULL;
 
        omap3isp_put(video->isp);
 
index a47c5d31c47550cd9c6c8803b25cda1253f906a9..6029d4e8e0bd34d60f1addb91a51bf5fd0709341 100644 (file)
@@ -2421,7 +2421,7 @@ static int vpe_release(struct file *file)
        vpdma_free_desc_buf(&ctx->sc_coeff_v);
        vpdma_free_desc_buf(&ctx->sc_coeff_h);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
index aadc3d8fb3d1c1267b370edac6723b99bd00f9bf..4cc9d00fd2936dcfaa4574d8bd9a23b9ae9b5476 100644 (file)
@@ -677,7 +677,7 @@ static int hantro_open(struct file *filp)
        return 0;
 
 err_fh_free:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, filp);
        v4l2_fh_exit(&ctx->fh);
 err_ctx_free:
        kfree(ctx);
@@ -693,7 +693,7 @@ static int hantro_release(struct file *filp)
         * to this file.
         */
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, filp);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->ctrl_handler);
        kfree(ctx);
index f20d9d9643f5e3d39f4807ad337f05c957594e1e..c340fd2260403e1750d1d094f7b1567c05a8f08d 100644 (file)
@@ -1946,7 +1946,7 @@ static int vicodec_release(struct file *file)
        mutex_lock(vfd->lock);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
        mutex_unlock(vfd->lock);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        kvfree(ctx->state.compressed_frame);
index 24574025f58fc34a0b98e8048294624607e39e2a..d0e760118c822aa7696b1cde2a6be5c9982ad639 100644 (file)
@@ -1450,7 +1450,7 @@ static int vim2m_release(struct file *file)
 
        dprintk(dev, 1, "Releasing instance %p\n", ctx);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        mutex_lock(&dev->dev_mutex);
index 0f43ec23f40b40362979646b47b09b75b7786fb2..26c6c6835f793a6ac273856bc9b3336a06bae1cd 100644 (file)
@@ -389,7 +389,7 @@ static int visl_release(struct file *file)
        dprintk(dev, "Releasing instance %p\n", ctx);
 
        tpg_free(&ctx->tpg);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        v4l2_ctrl_handler_free(&ctx->hdl);
        mutex_lock(&dev->dev_mutex);
index 04c77af0c51ec2174193387253015383d6fac486..f9535a484738a9ef25795daa11a74ccb0b914be9 100644 (file)
@@ -900,9 +900,8 @@ static int pvr2_v4l2_release(struct file *file)
                fhp->rhp = NULL;
        }
 
-       v4l2_fh_del(&fhp->fh);
+       v4l2_fh_del(&fhp->fh, file);
        v4l2_fh_exit(&fhp->fh);
-       file->private_data = NULL;
 
        pvr2_channel_done(&fhp->channel);
        pvr2_trace(PVR2_TRACE_STRUCT,
index b59b1084d8cdf1b62da12879e21dbe56c2109648..df3ba9d4674bd25626cfcddc2d0cb28c233e3cc3 100644 (file)
@@ -67,7 +67,7 @@ int v4l2_fh_open(struct file *filp)
 }
 EXPORT_SYMBOL_GPL(v4l2_fh_open);
 
-void v4l2_fh_del(struct v4l2_fh *fh)
+void v4l2_fh_del(struct v4l2_fh *fh, struct file *filp)
 {
        unsigned long flags;
 
@@ -75,6 +75,8 @@ void v4l2_fh_del(struct v4l2_fh *fh)
        list_del_init(&fh->list);
        spin_unlock_irqrestore(&fh->vdev->fh_lock, flags);
        v4l2_prio_close(fh->vdev->prio, fh->prio);
+
+       filp->private_data = NULL;
 }
 EXPORT_SYMBOL_GPL(v4l2_fh_del);
 
@@ -94,10 +96,9 @@ int v4l2_fh_release(struct file *filp)
        struct v4l2_fh *fh = file_to_v4l2_fh(filp);
 
        if (fh) {
-               v4l2_fh_del(fh);
+               v4l2_fh_del(fh, filp);
                v4l2_fh_exit(fh);
                kfree(fh);
-               filp->private_data = NULL;
        }
        return 0;
 }
index bf35ac436249fdbf218ed08a712abf546a49b4eb..41e4aca77b7fe432b1b27b3c1e7ffa8211297e1a 100644 (file)
@@ -109,7 +109,7 @@ static int subdev_open(struct file *file)
 
 err:
        module_put(subdev_fh->owner);
-       v4l2_fh_del(&subdev_fh->vfh);
+       v4l2_fh_del(&subdev_fh->vfh, file);
        v4l2_fh_exit(&subdev_fh->vfh);
        subdev_fh_free(subdev_fh);
        kfree(subdev_fh);
@@ -127,11 +127,10 @@ static int subdev_close(struct file *file)
        if (sd->internal_ops && sd->internal_ops->close)
                sd->internal_ops->close(sd, subdev_fh);
        module_put(subdev_fh->owner);
-       v4l2_fh_del(vfh);
+       v4l2_fh_del(vfh, file);
        v4l2_fh_exit(vfh);
        subdev_fh_free(subdev_fh);
        kfree(subdev_fh);
-       file->private_data = NULL;
 
        return 0;
 }
index 7fedb33dda347ab828725fda567e2ac43d1015ec..dc7f9a77cbe6770a58d8aa6f5af9f2f8d7d5cf67 100644 (file)
@@ -792,7 +792,7 @@ static int ipu_csc_scaler_open(struct file *file)
 err_ctrls:
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 err_ctx:
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
        return ret;
@@ -807,7 +807,7 @@ static int ipu_csc_scaler_release(struct file *file)
 
        v4l2_ctrl_handler_free(&ctx->ctrl_hdlr);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_fh_exit(&ctx->fh);
        kfree(ctx);
 
index b92666ff50a15196de0143f2ba5bf476c6f7729d..49e497a32973b8df18c5143e0db68d0f7f42c36c 100644 (file)
@@ -926,7 +926,7 @@ static int vdec_close(struct file *file)
 
        v4l2_m2m_ctx_release(sess->m2m_ctx);
        v4l2_m2m_release(sess->m2m_dev);
-       v4l2_fh_del(&sess->fh);
+       v4l2_fh_del(&sess->fh, file);
        v4l2_fh_exit(&sess->fh);
 
        mutex_destroy(&sess->lock);
index ebefd646dbdb4e998bf6a8a0f0be6d7e4bf7d28b..bff42ea1871f7376bfdb1dfad2ba7f22e862b0ea 100644 (file)
@@ -404,7 +404,7 @@ static int cedrus_release(struct file *file)
 
        mutex_lock(&dev->dev_mutex);
 
-       v4l2_fh_del(&ctx->fh);
+       v4l2_fh_del(&ctx->fh, file);
        v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
 
        v4l2_ctrl_handler_free(&ctx->hdl);
index 24a68e3e54195cf5f8952a35fe103d93bb0fd3e5..32f71d9a9cf78ad74aa8b9a53f40c1d52123df52 100644 (file)
@@ -107,7 +107,7 @@ static int comp_vdev_open(struct file *filp)
        return 0;
 
 err_rm:
-       v4l2_fh_del(&fh->fh);
+       v4l2_fh_del(&fh->fh, filp);
        v4l2_fh_exit(&fh->fh);
 
 err_dec:
@@ -143,7 +143,7 @@ static int comp_vdev_close(struct file *filp)
        most_stop_channel(mdev->iface, mdev->ch_idx, &comp);
        mdev->mute = false;
 
-       v4l2_fh_del(&fh->fh);
+       v4l2_fh_del(&fh->fh, filp);
        v4l2_fh_exit(&fh->fh);
 
        atomic_dec(&mdev->access_ref);
index 680f25d17dc2c7b99529441de8f079abe3b3411f..fd4b998ccd16058eb796dd317971c0869f6bdeb8 100644 (file)
@@ -692,8 +692,7 @@ uvc_v4l2_release(struct file *file)
                uvc_v4l2_disable(uvc);
        mutex_unlock(&video->mutex);
 
-       file->private_data = NULL;
-       v4l2_fh_del(&handle->vfh);
+       v4l2_fh_del(&handle->vfh, file);
        v4l2_fh_exit(&handle->vfh);
        kfree(handle);
 
index d8fcf49f10e09452b73499f4a9bd1285bc2835a5..5e4c761635120608e0b588e0b0daf63e69588d38 100644 (file)
@@ -114,12 +114,15 @@ int v4l2_fh_open(struct file *filp);
  * v4l2_fh_del - Remove file handle from the list of file handles.
  *
  * @fh: pointer to &struct v4l2_fh
+ * @filp: pointer to &struct file associated with @fh
+ *
+ * The function resets filp->private_data to NULL.
  *
  * .. note::
  *    Must be called in v4l2_file_operations->release\(\) handler if the driver
  *    uses &struct v4l2_fh.
  */
-void v4l2_fh_del(struct v4l2_fh *fh);
+void v4l2_fh_del(struct v4l2_fh *fh, struct file *filp);
 
 /**
  * v4l2_fh_exit - Release resources related to a file handle.