Re: [PATCH -next 12/13] media: rc: ir-rx51: 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:23PM +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/ir-rx51.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/rc/ir-rx51.c b/drivers/media/rc/ir-rx51.c
> index a3b145183260..85080c3d2053 100644
> --- a/drivers/media/rc/ir-rx51.c
> +++ b/drivers/media/rc/ir-rx51.c
> @@ -231,13 +231,8 @@ static int ir_rx51_probe(struct platform_device *dev)
>  	struct rc_dev *rcdev;
>  
>  	pwm = pwm_get(&dev->dev, NULL);
> -	if (IS_ERR(pwm)) {
> -		int err = PTR_ERR(pwm);
> -
> -		if (err != -EPROBE_DEFER)
> -			dev_err(&dev->dev, "pwm_get failed: %d\n", err);
> -		return err;
> -	}
> +	if (IS_ERR(pwm))
> +		return dev_err_probe(&dev->dev, PTR_ERR(pwm), "pwm_get failed\n");
>  
>  	/* Use default, in case userspace does not set the carrier */
>  	ir_rx51.freq = DIV_ROUND_CLOSEST_ULL(pwm_get_period(pwm), NSEC_PER_SEC);

-- 
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