From: Tharit Tangkijwanichakul <tharitt97@gmail.com>
To: linux-media@vger.kernel.org
Cc: skhan@linuxfoundation.org, linux-kernel-mentees@lists.linux.dev,
Tharit Tangkijwanichakul <tharitt97@gmail.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH] media: Documentation: fix v4l2-subdev incorrect ops field and category references
Date: Sat, 20 Jun 2026 15:18:42 +0700 [thread overview]
Message-ID: <20260620081843.7641-1-tharitt97@gmail.com> (raw)
The v4l2-subdev documentation incorrectly refers to the "core" ops
while it should have been the "video" ops where the actual
operation (g_std) belongs to. The docs also declares a duplicate
"video" struct member instead of "pad" in the subdev ops struct example.
Signed-off-by: Tharit Tangkijwanichakul <tharitt97@gmail.com>
---
Documentation/driver-api/media/v4l2-subdev.rst | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Documentation/driver-api/media/v4l2-subdev.rst b/Documentation/driver-api/media/v4l2-subdev.rst
index 13aec460e..d30bb656b 100644
--- a/Documentation/driver-api/media/v4l2-subdev.rst
+++ b/Documentation/driver-api/media/v4l2-subdev.rst
@@ -77,7 +77,7 @@ It looks like this:
const struct v4l2_subdev_tuner_ops *tuner;
const struct v4l2_subdev_audio_ops *audio;
const struct v4l2_subdev_video_ops *video;
- const struct v4l2_subdev_pad_ops *video;
+ const struct v4l2_subdev_pad_ops *pad;
};
The core ops are common to all subdevs, the other categories are implemented
@@ -300,31 +300,31 @@ directly:
.. code-block:: c
- err = sd->ops->core->g_std(sd, &norm);
+ err = sd->ops->video->g_std(sd, &norm);
but it is better and easier to use this macro:
.. code-block:: c
- err = v4l2_subdev_call(sd, core, g_std, &norm);
+ err = v4l2_subdev_call(sd, video, g_std, &norm);
The macro will do the right ``NULL`` pointer checks and returns ``-ENODEV``
if :c:type:`sd <v4l2_subdev>` is ``NULL``, ``-ENOIOCTLCMD`` if either
-:c:type:`sd <v4l2_subdev>`->core or :c:type:`sd <v4l2_subdev>`->core->g_std is ``NULL``, or the actual result of the
-:c:type:`sd <v4l2_subdev>`->ops->core->g_std ops.
+:c:type:`sd <v4l2_subdev>`->video or :c:type:`sd <v4l2_subdev>`->video->g_std is ``NULL``, or the actual result of the
+:c:type:`sd <v4l2_subdev>`->ops->video->g_std ops.
It is also possible to call all or a subset of the sub-devices:
.. code-block:: c
- v4l2_device_call_all(v4l2_dev, 0, core, g_std, &norm);
+ v4l2_device_call_all(v4l2_dev, 0, video, g_std, &norm);
Any subdev that does not support this ops is skipped and error results are
ignored. If you want to check for errors use this:
.. code-block:: c
- err = v4l2_device_call_until_err(v4l2_dev, 0, core, g_std, &norm);
+ err = v4l2_device_call_until_err(v4l2_dev, 0, video, g_std, &norm);
Any error except ``-ENOIOCTLCMD`` will exit the loop with that error. If no
errors (except ``-ENOIOCTLCMD``) occurred, then 0 is returned.
--
2.53.0
reply other threads:[~2026-06-20 8:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260620081843.7641-1-tharitt97@gmail.com \
--to=tharitt97@gmail.com \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox