[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <3708ae89092b13b1f2598b6a3c02987d6d920e4d.1693416477.git.mirq-linux@rere.qmqm.pl>
Date: Wed, 30 Aug 2023 19:35:32 +0200
From: Michał Mirosław <mirq-linux@...e.qmqm.pl>
To: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>
Cc: Douglas Anderson <dianders@...omium.org>,
linux-kernel@...r.kernel.org, Stephen Boyd <swboyd@...omium.org>
Subject: [PATCH v2 4/7] regulator/core: regulator_resolve_supply: remove gotos
Since 14a71d509ac8 ("Fix lockdep warning resolving supplies") the `out`
label is just `return ret;`. Inline it for easier reading.
Reviewed-by: Douglas Anderson <dianders@...omium.org>
Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
---
drivers/regulator/core.c | 27 +++++++++++----------------
1 file changed, 11 insertions(+), 16 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index f18e7cb88a0d..e89c12d27a9d 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2039,7 +2039,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
struct regulator_dev *r;
struct device *dev = rdev->dev.parent;
struct ww_acquire_ctx ww_ctx;
- int ret = 0;
+ int ret;
/* No supply to resolve? */
if (!rdev->supply_name)
@@ -2055,7 +2055,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
/* Did the lookup explicitly defer for us? */
if (ret == -EPROBE_DEFER)
- goto out;
+ return ret;
if (have_full_constraints()) {
r = dummy_regulator_rdev;
@@ -2063,18 +2063,15 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
} else {
dev_err(dev, "Failed to resolve %s-supply for %s\n",
rdev->supply_name, rdev->desc->name);
- ret = -EPROBE_DEFER;
- goto out;
+ return -EPROBE_DEFER;
}
}
if (r == rdev) {
dev_err(dev, "Supply for %s (%s) resolved to itself\n",
rdev->desc->name, rdev->supply_name);
- if (!have_full_constraints()) {
- ret = -EINVAL;
- goto out;
- }
+ if (!have_full_constraints())
+ return -EINVAL;
r = dummy_regulator_rdev;
get_device(&r->dev);
}
@@ -2088,8 +2085,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (r->dev.parent && r->dev.parent != rdev->dev.parent) {
if (!device_is_bound(r->dev.parent)) {
put_device(&r->dev);
- ret = -EPROBE_DEFER;
- goto out;
+ return -EPROBE_DEFER;
}
}
@@ -2097,7 +2093,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
ret = regulator_resolve_supply(r);
if (ret < 0) {
put_device(&r->dev);
- goto out;
+ return ret;
}
/*
@@ -2111,14 +2107,14 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (rdev->supply) {
regulator_unlock_two(rdev, r, &ww_ctx);
put_device(&r->dev);
- goto out;
+ return 0;
}
ret = set_supply(rdev, r);
if (ret < 0) {
regulator_unlock_two(rdev, r, &ww_ctx);
put_device(&r->dev);
- goto out;
+ return ret;
}
regulator_unlock_two(rdev, r, &ww_ctx);
@@ -2133,12 +2129,11 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
if (ret < 0) {
_regulator_put(rdev->supply);
rdev->supply = NULL;
- goto out;
+ return ret;
}
}
-out:
- return ret;
+ return 0;
}
/* Internal regulator request function */
--
2.39.2
Powered by blists - more mailing lists