[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8a77f74b-12aa-4aac-a3d3-4ec8be8d2cf3@kernel.org>
Date: Mon, 2 Jun 2025 11:46:02 +0200
From: Hans de Goede <hansg@...nel.org>
To: Ricardo Ribalda <ribalda@...omium.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Hans de Goede <hdegoede@...hat.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>, Hans Verkuil <hverkuil@...all.nl>
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 6/9] media: uvcvideo: Do not enable camera during
UVCIOC_CTRL_MAP32
Hi Ricardo,
On 28-May-25 19:58, Ricardo Ribalda wrote:
> The device does not need to be enabled to do this, it is merely an
> internal data operation.
>
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>
> ---
> drivers/media/usb/uvc/uvc_v4l2.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> index 65c708b3fb1066bf2e8f12ab7cdf119452ad40f9..2c6f3cf6bcc3f116bbdb3383d9af7d5be9832537 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -1224,10 +1224,6 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
> void __user *up = compat_ptr(arg);
> long ret;
>
> - ret = uvc_pm_get(handle->stream->dev);
> - if (ret)
> - return ret;
> -
> switch (cmd) {
> case UVCIOC_CTRL_MAP32:
> ret = uvc_v4l2_get_xu_mapping(&karg.xmap, up);
> @@ -1245,7 +1241,13 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
> ret = uvc_v4l2_get_xu_query(&karg.xqry, up);
> if (ret)
> break;
> +
> + ret = uvc_pm_get(handle->stream->dev);
> + if (ret)
> + return ret;
The rest of the code here uses:
if (ret)
break;
as pattern, please also use that for the uvc_pm_get() error handling
Otherwise this looks good to me:
Reviewed-by: Hans de Goede <hansg@...nel.org>
Regards,
Hans
> ret = uvc_xu_ctrl_query(handle->chain, &karg.xqry);
> + uvc_pm_put(handle->stream->dev);
> +
> if (ret)
> break;
> ret = uvc_v4l2_put_xu_query(&karg.xqry, up);
> @@ -1258,8 +1260,6 @@ static long uvc_v4l2_compat_ioctl32(struct file *file,
> break;
> }
>
> - uvc_pm_put(handle->stream->dev);
> -
> return ret;
> }
> #endif
>
Powered by blists - more mailing lists