]> Gentwo Git Trees - linux/.git/commit
media: Replace file->private_data access with file_to_v4l2_fh()
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Sun, 10 Aug 2025 01:29:51 +0000 (04:29 +0300)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 13 Aug 2025 06:33:25 +0000 (08:33 +0200)
commit8003313d388f11cfcaaa88a731f113afda171887
treee32e9c2423fff1cfc28f62484ffd8e20b65e6e7c
parent618882c92681de18e9bd99d2a88bb21c897283f3
media: Replace file->private_data access with file_to_v4l2_fh()

Accessing file->private_data manually to retrieve the v4l2_fh pointer is
error-prone, as the field is a void * and will happily cast implicitly
to any pointer type.

Replace all remaining locations that read the v4l2_fh pointer directly
from file->private_data with usage of the file_to_v4l2_fh() function.
The change was generated manually.

No functional change is intended, this only paves the way to remove
direct accesses to file->private_data and make V4L2 drivers safer.
Other accesses to the field will be addressed separately.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
27 files changed:
drivers/media/pci/cx18/cx18-driver.h
drivers/media/pci/cx18/cx18-fileops.c
drivers/media/pci/saa7164/saa7164.h
drivers/media/platform/amphion/vpu.h
drivers/media/platform/imagination/e5010-jpeg-enc.h
drivers/media/platform/nxp/dw100/dw100.c
drivers/media/platform/nxp/imx-pxp.c
drivers/media/platform/qcom/iris/iris_vidc.c
drivers/media/platform/qcom/venus/core.h
drivers/media/platform/samsung/s3c-camif/camif-capture.c
drivers/media/platform/sunxi/sun8i-di/sun8i-di.c
drivers/media/platform/sunxi/sun8i-rotate/sun8i_rotate.c
drivers/media/platform/ti/vpe/vpe.c
drivers/media/test-drivers/vicodec/vicodec-core.c
drivers/media/test-drivers/vim2m.c
drivers/media/test-drivers/visl/visl.h
drivers/media/test-drivers/vivid/vivid-core.c
drivers/media/test-drivers/vivid/vivid-radio-rx.c
drivers/media/test-drivers/vivid/vivid-radio-tx.c
drivers/media/usb/hdpvr/hdpvr-video.c
drivers/media/usb/pvrusb2/pvrusb2-v4l2.c
drivers/media/usb/uvc/uvcvideo.h
drivers/media/v4l2-core/v4l2-compat-ioctl32.c
drivers/media/v4l2-core/v4l2-ioctl.c
drivers/staging/most/video/video.c
drivers/usb/gadget/function/uvc.h
drivers/usb/gadget/function/uvc_v4l2.c