summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2023-01-09 18:59:09 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-01-10 15:37:47 +0100
commit9b7cfbc1525db18ed2acfc13c5c86feab0c6ef53 (patch)
treef83f46c32d2608f95e6900f45fbd7f4966508a2e /drivers/regulator
parentf08e9449051901e96c032d2f2368e68902b9e6e3 (diff)
downloadbarebox-9b7cfbc1525db18ed2acfc13c5c86feab0c6ef53.tar.gz
regulator: rk808: simplify one error branch with dev_err_probe
This has the added benefit of recording the error message. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20230109175909.2018186-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/rk808-regulator.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index f8bc31f354..c53017c1e5 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);