Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: v4l2-fh: define v4l2_fh struct regardless of condition

v4l2_fh struct define differently by CONFIG_V4L2_MEM2MEM_DEV.
If some vendors use CONFIG_V4L2_MEM2MEM_DEV by module,
it can make the mismatch of v4l2_fh sturct.

By the mismatch, the following error occurs.
===============================
[ 7.533506] v4l2_mem2mem: disagrees about version of symbol video_devdata
[ 7.533594] v4l2_mem2mem: Unknown symbol video_devdata (err -22)
[ 7.535319] v4l2_mem2mem: disagrees about version of symbol v4l2_event_pending
[ 7.542532] v4l2_mem2mem: Unknown symbol v4l2_event_pending (err -22)
===============================

So v4l2_fh struct is modified to does not have dependency
for CONFIG_V4L2_MEM2MEM_DEV.

Signed-off-by: Seungchul Kim <sc377.kim@samsung.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

authored by

Seungchul Kim and committed by
Mauro Carvalho Chehab
d6ef0719 00349298

-4
-2
drivers/media/v4l2-core/v4l2-ioctl.c
··· 2805 2805 { 2806 2806 if (_IOC_NR(cmd) >= V4L2_IOCTLS) 2807 2807 return vdev->lock; 2808 - #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) 2809 2808 if (vfh && vfh->m2m_ctx && 2810 2809 (v4l2_ioctls[_IOC_NR(cmd)].flags & INFO_FL_QUEUE)) { 2811 2810 if (vfh->m2m_ctx->q_lock) 2812 2811 return vfh->m2m_ctx->q_lock; 2813 2812 } 2814 - #endif 2815 2813 if (vdev->queue && vdev->queue->lock && 2816 2814 (v4l2_ioctls[_IOC_NR(cmd)].flags & INFO_FL_QUEUE)) 2817 2815 return vdev->queue->lock;
-2
include/media/v4l2-fh.h
··· 53 53 unsigned int navailable; 54 54 u32 sequence; 55 55 56 - #if IS_ENABLED(CONFIG_V4L2_MEM2MEM_DEV) 57 56 struct v4l2_m2m_ctx *m2m_ctx; 58 - #endif 59 57 }; 60 58 61 59 /**