All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Jean Delvare <jdelvare@suse.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: (pmbus) Use dev_err_probe() to filter -EPROBE_DEFER error messages
Date: Wed, 17 Aug 2022 08:31:10 -0700	[thread overview]
Message-ID: <20220817153110.GA1333586@roeck-us.net> (raw)
In-Reply-To: <3adf1cea6e32e54c0f71f4604b4e98d992beaa71.1660741419.git.christophe.jaillet@wanadoo.fr>

On Wed, Aug 17, 2022 at 03:04:00PM +0200, Christophe JAILLET wrote:
> devm_regulator_register() can return -EPROBE_DEFER, so better use
> dev_err_probe() instead of dev_err(), it is less verbose in such a case.
> 
> It is also more informative, which can't hurt.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied

Thanks,
Guenter

> ---
>  drivers/hwmon/pmbus/pmbus_core.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/hwmon/pmbus/pmbus_core.c b/drivers/hwmon/pmbus/pmbus_core.c
> index 5541d26e8623..e000674d50df 100644
> --- a/drivers/hwmon/pmbus/pmbus_core.c
> +++ b/drivers/hwmon/pmbus/pmbus_core.c
> @@ -3016,11 +3016,10 @@ static int pmbus_regulator_register(struct pmbus_data *data)
>  
>  		rdev = devm_regulator_register(dev, &info->reg_desc[i],
>  					       &config);
> -		if (IS_ERR(rdev)) {
> -			dev_err(dev, "Failed to register %s regulator\n",
> -				info->reg_desc[i].name);
> -			return PTR_ERR(rdev);
> -		}
> +		if (IS_ERR(rdev))
> +			return dev_err_probe(dev, PTR_ERR(rdev),
> +					     "Failed to register %s regulator\n",
> +					     info->reg_desc[i].name);
>  	}
>  
>  	return 0;

      reply	other threads:[~2022-08-17 15:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 13:04 [PATCH] hwmon: (pmbus) Use dev_err_probe() to filter -EPROBE_DEFER error messages Christophe JAILLET
2022-08-17 15:31 ` Guenter Roeck [this message]

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=20220817153110.GA1333586@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=jdelvare@suse.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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.