mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] regulator: rk808: simplify one error branch with dev_err_probe
@ 2023-01-09 17:59 Ahmad Fatoum
  2023-01-10 14:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2023-01-09 17:59 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

This has the added benefit of recording the error message.

Signed-off-by: Ahmad Fatoum <ahmad@a3f.at>
---
 drivers/regulator/rk808-regulator.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index 3da6cca294ae..8c96b99c9be5 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -783,10 +783,9 @@ static int rk808_regulator_register(struct rk808 *rk808, int id,
 	cfg->rdev.regmap = rk808->regmap;
 
 	ret = of_regulator_register(&cfg->rdev, match->of_node);
-	if (ret) {
-		dev_err(dev, "failed to register %s regulator\n", match->name);
-		return ret;
-	}
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to register %s regulator\n",
+				     match->name);
 
 	dev_dbg(dev, "registered %s\n", match->name);
 
-- 
2.38.1




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-10 14:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-09 17:59 [PATCH] regulator: rk808: simplify one error branch with dev_err_probe Ahmad Fatoum
2023-01-10 14:37 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox