Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hans@jjverkuil.nl>
Subject: Re: [PATCH v4 3/3] media: Documentation: Document new v4l2_ctrl_handler_free() behaviour
Date: Mon, 23 Jun 2025 15:28:38 +0300	[thread overview]
Message-ID: <20250623122838.GH826@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20250623122314.2346635-4-sakari.ailus@linux.intel.com>

On Mon, Jun 23, 2025 at 03:23:14PM +0300, Sakari Ailus wrote:
> v4l2_ctrl_handler_free() no longer resets the handler's error code.
> Document it.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  Documentation/driver-api/media/v4l2-controls.rst | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/driver-api/media/v4l2-controls.rst b/Documentation/driver-api/media/v4l2-controls.rst
> index b2e91804829b..fc04907589ab 100644
> --- a/Documentation/driver-api/media/v4l2-controls.rst
> +++ b/Documentation/driver-api/media/v4l2-controls.rst
> @@ -110,6 +110,7 @@ For sub-device drivers:
>  
>  	v4l2_ctrl_handler_free(&foo->ctrl_handler);
>  
> +:c:func:`v4l2_ctrl_handler_free` does not touch the handler's ``error`` field.
>  
>  2) Add controls:
>  
> @@ -191,12 +192,8 @@ These functions are typically called right after the
>  			V4L2_CID_TEST_PATTERN, ARRAY_SIZE(test_pattern) - 1, 0,
>  			0, test_pattern);
>  	...
> -	if (foo->ctrl_handler.error) {
> -		int err = foo->ctrl_handler.error;
> -
> -		v4l2_ctrl_handler_free(&foo->ctrl_handler);
> -		return err;
> -	}
> +	if (foo->ctrl_handler.error)
> +		return v4l2_ctrl_handler_free(&foo->ctrl_handler);
>  
>  The :c:func:`v4l2_ctrl_new_std` function returns the v4l2_ctrl pointer to
>  the new control, but if you do not need to access the pointer outside the

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2025-06-23 12:28 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-23 12:23 [PATCH v3 0/3] Control handler free changes Sakari Ailus
2025-06-23 12:23 ` [PATCH v4 1/3] media: v4l2-ctrls: Don't reset handler's error in v4l2_ctrl_handler_free() Sakari Ailus
2025-06-23 12:25   ` Laurent Pinchart
2025-06-23 12:23 ` [PATCH v4 2/3] media: v4l2-ctrls: Return the " Sakari Ailus
2025-06-23 12:27   ` Laurent Pinchart
2025-06-23 12:29     ` Laurent Pinchart
2025-06-23 12:58     ` Hans Verkuil
2025-06-23 12:56   ` Hans Verkuil
2025-06-23 12:23 ` [PATCH v4 3/3] media: Documentation: Document new v4l2_ctrl_handler_free() behaviour Sakari Ailus
2025-06-23 12:28   ` Laurent Pinchart [this message]
2025-06-23 13:00   ` Hans Verkuil

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=20250623122838.GH826@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hans@jjverkuil.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    /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