Re: [PATCH -next 11/13] media: rc: gpio-ir-tx: Switch to use dev_err_probe() helper

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

 



Hi Yang,

Thank you for the patch.

On Thu, Sep 15, 2022 at 11:03:22PM +0800, Yang Yingliang 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: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

> ---
>  drivers/media/rc/gpio-ir-tx.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/rc/gpio-ir-tx.c b/drivers/media/rc/gpio-ir-tx.c
> index d3063ddb472e..2b829c146db1 100644
> --- a/drivers/media/rc/gpio-ir-tx.c
> +++ b/drivers/media/rc/gpio-ir-tx.c
> @@ -174,12 +174,9 @@ static int gpio_ir_tx_probe(struct platform_device *pdev)
>  		return -ENOMEM;
>  
>  	gpio_ir->gpio = devm_gpiod_get(&pdev->dev, NULL, GPIOD_OUT_LOW);
> -	if (IS_ERR(gpio_ir->gpio)) {
> -		if (PTR_ERR(gpio_ir->gpio) != -EPROBE_DEFER)
> -			dev_err(&pdev->dev, "Failed to get gpio (%ld)\n",
> -				PTR_ERR(gpio_ir->gpio));
> -		return PTR_ERR(gpio_ir->gpio);
> -	}
> +	if (IS_ERR(gpio_ir->gpio))
> +		return dev_err_probe(&pdev->dev, PTR_ERR(gpio_ir->gpio),
> +				     "Failed to get gpio\n");
>  
>  	rcdev->priv = gpio_ir;
>  	rcdev->driver_name = DRIVER_NAME;

-- 
Regards,

Laurent Pinchart



[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