All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Yang Yingliang <yangyingliang@huawei.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org,
	hverkuil-cisco@xs4all.nl, pavel@ucw.cz,
	sakari.ailus@linux.intel.com, sean@mess.org
Subject: Re: [PATCH -next 02/13] media: i2c: ad5820: Switch to use dev_err_probe() helper
Date: Mon, 19 Sep 2022 17:37:13 +0300	[thread overview]
Message-ID: <Yyh+mb3xUiBRUolY@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220915150324.688062-3-yangyingliang@huawei.com>

Hi Yang,

Thank you for the patch.

On Thu, Sep 15, 2022 at 11:03:13PM +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@huawei.com>

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

> ---
>  drivers/media/i2c/ad5820.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/media/i2c/ad5820.c b/drivers/media/i2c/ad5820.c
> index 516de278cc49..6a7f8ef9db05 100644
> --- a/drivers/media/i2c/ad5820.c
> +++ b/drivers/media/i2c/ad5820.c
> @@ -301,21 +301,15 @@ static int ad5820_probe(struct i2c_client *client,
>  		return -ENOMEM;
>  
>  	coil->vana = devm_regulator_get(&client->dev, "VANA");
> -	if (IS_ERR(coil->vana)) {
> -		ret = PTR_ERR(coil->vana);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(&client->dev, "could not get regulator for vana\n");
> -		return ret;
> -	}
> +	if (IS_ERR(coil->vana))
> +		return dev_err_probe(&client->dev, PTR_ERR(coil->vana),
> +				     "could not get regulator for vana\n");
>  
>  	coil->enable_gpio = devm_gpiod_get_optional(&client->dev, "enable",
>  						    GPIOD_OUT_LOW);
> -	if (IS_ERR(coil->enable_gpio)) {
> -		ret = PTR_ERR(coil->enable_gpio);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(&client->dev, "could not get enable gpio\n");
> -		return ret;
> -	}
> +	if (IS_ERR(coil->enable_gpio))
> +		return dev_err_probe(&client->dev, PTR_ERR(coil->enable_gpio),
> +				     "could not get enable gpio\n");
>  
>  	mutex_init(&coil->power_lock);
>  

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2022-09-19 14:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 15:03 [PATCH -next 00/13] media: Switch to use dev_err_probe() helper Yang Yingliang
2022-09-15 15:03 ` [PATCH -next 01/13] media: platform: stm32-cec: " Yang Yingliang
2022-09-19 14:32   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 02/13] media: i2c: ad5820: " Yang Yingliang
2022-09-19 14:37   ` Laurent Pinchart [this message]
2022-09-15 15:03 ` [PATCH -next 03/13] media: i2c: imx274: " Yang Yingliang
2022-09-19 14:07   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 04/13] media: i2c: tc358743: " Yang Yingliang
2022-09-19 14:30   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 05/13] media: platform: mtk_mdp_comp: " Yang Yingliang
2022-09-19 14:40   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 06/13] media: platform: exynos4-is: " Yang Yingliang
2022-09-19 14:28   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 07/13] media: stm32-dcmi: " Yang Yingliang
2022-09-19 14:23   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 08/13] media: omap3isp: " Yang Yingliang
2022-09-19 14:05   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 09/13] media: xilinx: csi2rxss: " Yang Yingliang
2022-09-19 13:58   ` Laurent Pinchart
2022-09-19 14:07     ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 10/13] media: rc: gpio-ir-recv: " Yang Yingliang
2022-09-15 16:38   ` Sean Young
2022-09-16  1:13     ` Yang Yingliang
2022-09-16  9:46       ` Sean Young
2022-09-15 15:03 ` [PATCH -next 11/13] media: rc: gpio-ir-tx: " Yang Yingliang
2022-09-19 14:22   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 12/13] media: rc: ir-rx51: " Yang Yingliang
2022-09-19 14:36   ` Laurent Pinchart
2022-09-15 15:03 ` [PATCH -next 13/13] media: uvcvideo: " Yang Yingliang
2022-09-18 13:16   ` Ricardo Ribalda
2022-09-19 13:59   ` Laurent Pinchart
2022-09-19 14:42 ` [PATCH -next 00/13] media: " Laurent Pinchart
2022-09-19 15:30   ` Yang Yingliang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yyh+mb3xUiBRUolY@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pavel@ucw.cz \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sean@mess.org \
    --cc=yangyingliang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.