From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7897E340A76 for ; Sat, 20 Jun 2026 08:19:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781943547; cv=none; b=jrV0fCvTRSlZrsvAaeIN0eW58AnDmxR4+EpBuZh8Nnu4bNGFHS91GhvIS14kzrxAcBFi52XQoGKXvUHoB/Lf5m5sPiK72Q4/X4cioG1rwOuRp+FGxPEx5EDubSvOIQ+jRgx+yBBMPaUNxstyVD+1r9Ygi7wboor95fZcpK7F3BI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781943547; c=relaxed/simple; bh=ebjICIaKnIiWqN5sCqRzBeqtjhGLBHhcjtqnFhx4W3c=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=nsdO9LreFzXmLWkgNvuSV9AiVNrrMVh3ou89hl5ESg4ONC/qdqt3vwmMkcnkgFcoPgt+bSQC3qSPw/bF0ZFxA1u7hJleti9ETs0JrwNQZRbMCXvbI6Jp8rh+LISkAS4v4+ZXw2e4NtNYWJHkValECY0Mez1TeYx9CGy4/H4SVcQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nojLOuZy; arc=none smtp.client-ip=209.85.216.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nojLOuZy" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-36da151a152so1673894a91.1 for ; Sat, 20 Jun 2026 01:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781943546; x=1782548346; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FYONhAjYo50YxLgZHUBiBRUd34pR6NaLMu1zrzWmCZk=; b=nojLOuZy5ZUe5cyR65QKPUE3xqXJKn4STcxpm4wNmL/6BeP8V7zHz4yOnPBxE4YVEZ nxvvpvXXE8YSUbMD6cugx7L0oXC26t4NhxCQQLSPESLWXq9tsiIVbjjCboUYZmrANTES OgcCj4ZbqpID2cGOIrxdpIhf1QSsLWvqeR1DoKv72j5KTrgkupTKozwm+nbBSMTmTJ+o nG7UeGuqdI0stdic5ezaM5a02cigXONBlcKZIeKE7Y9sid/mAm0ydErqR7eIKbfIT6d8 satzbDB18pVDOw1YHItNsF9UTw77djmGnruqvHytudGHwXRk/oHbD3F3KlgqgL4sscDN RGVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781943546; x=1782548346; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=FYONhAjYo50YxLgZHUBiBRUd34pR6NaLMu1zrzWmCZk=; b=Z8NroJKvXRWxllyqYxKI7+hW8Dhbs1A52wmZSr97NXhKyacfy/ZBbdAAeT59APsYCt 36XeFPZTvkElOOZdFXBqICjF5BkuzqEIXb8wbWmla6zHC3T7+cuuq7s2O4c44+kxpHw6 yTvmNNkZrFDk6SXJv6M+D+GyCLvfJafdFPVKngistbGDAcIgO5am96KvkQ2sJJ/LSALe m8mkPeBzwzeQCI4K3URNBrZOKJHRQMRrt7UDrp/BDpqTOWsP6P/1apN33GWawSasIm1L /VLT5y/3mbfO7gRKmw8NS7sQdcYIsKhXE9CuXhvBfs719VdxDi5t7lHi8d/rq7Gqkjl/ VM+A== X-Forwarded-Encrypted: i=1; AFNElJ+O10CmNK6wDwNyl7MwwQeZu07gclp48ubrsX4BOYeM2CKAOA6+oEu0IqAZC4z+tjFOcGhQSWJ3nA4NZ4M=@vger.kernel.org X-Gm-Message-State: AOJu0YyF+L8KxKMsw/ZtarWGtwZlXG4ATtirvm9WODU4y03sCGxT5dIZ UrAktVcucMt6jKtv1bEBbmmjtUG922X9hSn0qoUETMX/jvXPdtEVbj1V X-Gm-Gg: AfdE7cmEofGQhb7s2h2kbdhErGIXJU0mP8jVLgtYygxY1X/bpc4+47JCibPRVIm8RXN 27FrX/ODoKQPr6Ux7HVgh+OgxkDccfX26NzTqbZEMD8u5BwavBUwQVGctbywrG+3t4kDXf3rgGC JPuEsMt5IzJnCz5YDFKxnX6VV0OmxPwuSPFDu73HoGJUj6PnRwsz33jKdO8+VbYOI9zLrGDapJe UnpjjlWdLpmW/0Vo2yWXK8IIYuzDCnwtlG4LKQ9T+2NOM/UpO98jBhHagYAnr93/5a0TuJ6qzk8 0qI84sX1XBYDmEK6VwbBHOoFD5ef4PaacNei08+1fSEm0XLNvI/MBh60dTGnCPzynXSmuZJyG7o qn8zHsu3mOZEzhXsDvUNyvMpHLcHl1wr4Yca9x67YN+w2jUBBmsl5HdZwR83bn0WxObgBBbcZOo bTex3XsIHTZ1etMfNpB7qdR1uVNYyruJ5tQNLe X-Received: by 2002:a17:90b:4d11:b0:37c:6973:5a65 with SMTP id 98e67ed59e1d1-37d15e89d6cmr7349122a91.17.1781943545714; Sat, 20 Jun 2026 01:19:05 -0700 (PDT) Received: from x1c ([2405:9800:b670:b64b:5c2d:70e2:75f2:925]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-37d4eede23esm1601366a91.2.2026.06.20.01.19.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jun 2026 01:19:05 -0700 (PDT) From: Tharit Tangkijwanichakul To: linux-media@vger.kernel.org Cc: skhan@linuxfoundation.org, linux-kernel-mentees@lists.linux.dev, Tharit Tangkijwanichakul , Mauro Carvalho Chehab , 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 Message-ID: <20260620081843.7641-1-tharitt97@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- 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 ` is ``NULL``, ``-ENOIOCTLCMD`` if either -:c:type:`sd `->core or :c:type:`sd `->core->g_std is ``NULL``, or the actual result of the -:c:type:`sd `->ops->core->g_std ops. +:c:type:`sd `->video or :c:type:`sd `->video->g_std is ``NULL``, or the actual result of the +:c:type:`sd `->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