Re: [PATCH -next 13/13] media: uvcvideo: Switch to use dev_err_probe() helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 15 Sept 2022 at 16:05, Yang Yingliang <yangyingliang@xxxxxxxxxx> wrote:
>
> In the probe path, dev_err() can be replace with dev_err_probe()
> which will check if error code is -EPROBE_DEFER.
>
> Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
Reviewed-by: Ricardo Ribalda <ribalda@xxxxxxxxxxxx>
> ---
>  drivers/media/usb/uvc/uvc_driver.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
> index 744051b52e12..94f84c3c4712 100644
> --- a/drivers/media/usb/uvc/uvc_driver.c
> +++ b/drivers/media/usb/uvc/uvc_driver.c
> @@ -1554,12 +1554,9 @@ static int uvc_gpio_parse(struct uvc_device *dev)
>                 return PTR_ERR_OR_ZERO(gpio_privacy);
>
>         irq = gpiod_to_irq(gpio_privacy);
> -       if (irq < 0) {
> -               if (irq != EPROBE_DEFER)
> -                       dev_err(&dev->udev->dev,
> -                               "No IRQ for privacy GPIO (%d)\n", irq);
> -               return irq;
> -       }
> +       if (irq < 0)
> +               return dev_err_probe(&dev->udev->dev, irq,
> +                                    "No IRQ for privacy GPIO\n");
>
>         unit = uvc_alloc_entity(UVC_EXT_GPIO_UNIT, UVC_EXT_GPIO_UNIT_ID, 0, 1);
>         if (!unit)
> --
> 2.25.1
>


-- 
Ricardo Ribalda



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux