lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250422180832.GK17813@pendragon.ideasonboard.com>
Date: Tue, 22 Apr 2025 21:08:32 +0300
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Ricardo Ribalda <ribalda@...omium.org>
Cc: Hans de Goede <hdegoede@...hat.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	Doug Anderson <dianders@...omium.org>
Subject: Re: [PATCH v3 2/2] media: uvcvideo: Use dev_err_probe for
 devm_gpiod_get_optional

Hi Ricardo,

Thank you for the patch.

On Thu, Mar 13, 2025 at 12:20:40PM +0000, Ricardo Ribalda wrote:
> Use the dev_err_probe() helper for devm_gpiod_get_optional(), like we do
> with gpiod_to_irq()
> 
> That eventually calls device_set_deferred_probe_reason() which can be
> helpful for tracking down problems.
> 
> Now that all the error paths in uvc_gpio_parse have dev_err_probe, we
> can remove the error message in uvc_probe.
> 
> Suggested-by: Doug Anderson <dianders@...omium.org>
> Reviewed-by: Douglas Anderson <dianders@...omium.org>
> Signed-off-by: Ricardo Ribalda <ribalda@...omium.org>

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

> ---
>  drivers/media/usb/uvc/uvc_driver.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index e966bdb9239f345fd157588ebdad2b3ebe45168d..d8e51c3db7575bebe7bb700b53b50ae02d355d8e 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1297,8 +1297,13 @@ static int uvc_gpio_parse(struct uvc_device *dev)
>  
>  	gpio_privacy = devm_gpiod_get_optional(&dev->intf->dev, "privacy",
>  					       GPIOD_IN);
> -	if (IS_ERR_OR_NULL(gpio_privacy))
> -		return PTR_ERR_OR_ZERO(gpio_privacy);
> +	if (!gpio_privacy)
> +		return 0;
> +
> +	if (IS_ERR(gpio_privacy))
> +		return dev_err_probe(&dev->intf->dev,
> +				     PTR_ERR(gpio_privacy),
> +				     "Can't get privacy GPIO\n");
>  
>  	irq = gpiod_to_irq(gpio_privacy);
>  	if (irq < 0)
> @@ -2240,10 +2245,8 @@ static int uvc_probe(struct usb_interface *intf,
>  
>  	/* Parse the associated GPIOs. */
>  	ret = uvc_gpio_parse(dev);
> -	if (ret < 0) {
> -		uvc_dbg(dev, PROBE, "Unable to parse UVC GPIOs\n");
> +	if (ret < 0)
>  		goto error;
> -	}
>  
>  	dev_info(&dev->udev->dev, "Found UVC %u.%02x device %s (%04x:%04x)\n",
>  		 dev->uvc_version >> 8, dev->uvc_version & 0xff,

-- 
Regards,

Laurent Pinchart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ