[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220817153110.GA1333586@roeck-us.net>
Date: Wed, 17 Aug 2022 08:31:10 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Jean Delvare <jdelvare@...e.com>, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, linux-hwmon@...r.kernel.org
Subject: Re: [PATCH] hwmon: (pmbus) Use dev_err_probe() to filter
-EPROBE_DEFER error messages
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@...adoo.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;
Powered by blists - more mailing lists