mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <ahmad@a3f.at>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <ahmad@a3f.at>
Subject: [PATCH] regulator: rk808: simplify one error branch with dev_err_probe
Date: Mon,  9 Jan 2023 18:59:09 +0100	[thread overview]
Message-ID: <20230109175909.2018186-1-ahmad@a3f.at> (raw)

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




             reply	other threads:[~2023-01-09 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 17:59 Ahmad Fatoum [this message]
2023-01-10 14:37 ` Sascha Hauer

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=20230109175909.2018186-1-ahmad@a3f.at \
    --to=ahmad@a3f.at \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox