Skip to contentSkip to conversation

media: videodev2.h: Fix struct v4l2_input tuner index comment

PATCH New Marek Vasut 1 participant 1 message May 18, 2023 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: videodev2.h: Fix struct v4l2_input tuner index comment

VIDIOC_ENUMINPUT documentation describes the tuner field of struct v4l2_input as index:

Documentation/userspace-api/media/v4l/vidioc-enuminput.rst "
* - __u32
- ``tuner``
- Capture devices can have zero or more tuners (RF demodulators). When the ``type`` is set to ``V4L2_INPUT_TYPE_TUNER`` this is an RF connector and this field identifies the tuner. It corresponds to struct :c:type:v4l2_tuner field ``index``. For details on tuners see :ref:tuner.
"

Drivers I could find also use the 'tuner' field as an index, e.g.:
drivers/media/pci/bt8xx/bttv-driver.c bttv_enum_input() drivers/media/usb/go7007/go7007-v4l2.c vidioc_enum_input()

However, the UAPI comment claims this field is 'enum v4l2_tuner_type':
include/uapi/linux/videodev2.h

This field being 'enum v4l2_tuner_type' is unlikely as it seems to be never used that way in drivers, and documentation confirms it. It seem this comment got in accidentally in the commit which this patch fixes. Fix the UAPI comment to stop confusion.

This was pointed out by Dmitry while reviewing VIDIOC_ENUMINPUT support for strace.

Fixes 6016af82eafc ("[media] v4l2: use __u32 rather than enums in ioctl() structs")

---
Cc: Dmitry V. Levin <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Sakari Ailus <[email protected]>
Cc: [email protected]

---
 include/uapi/linux/videodev2.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/videodev2.h +1 -1
index aee75eb9e6863..192afa88539a8 100644
@@ -1720,7 +1720,7 @@ struct v4l2_input {
 	__u8	     name[32];		/*  Label */
 	__u32	     type;		/*  Type of input */
 	__u32	     audioset;		/*  Associated audios (bitfield) */
-	__u32        tuner;             /*  enum v4l2_tuner_type */
+	__u32        tuner;             /*  Tuner index */
 	v4l2_std_id  std;
 	__u32	     status;
 	__u32	     capabilities;
Signature · 1 line
2.39.2