* [PATCH] hwmon: (pmbus) Use dev_err_probe() to filter -EPROBE_DEFER error messages
@ 2022-08-17 13:04 Christophe JAILLET
2022-08-17 15:31 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-08-17 13:04 UTC (permalink / raw)
To: Guenter Roeck, Jean Delvare
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-hwmon
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>
---
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;
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: (pmbus) Use dev_err_probe() to filter -EPROBE_DEFER error messages
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
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2022-08-17 15:31 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Jean Delvare, linux-kernel, kernel-janitors, linux-hwmon
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;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-17 15:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).