[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20251227-regulators-defer-v1-5-3104b22d84cb@linaro.org>
Date: Sat, 27 Dec 2025 12:17:49 +0000
From: André Draszik <andre.draszik@...aro.org>
To: Liam Girdwood <lgirdwood@...il.com>, Mark Brown <broonie@...nel.org>,
Javier Martinez Canillas <javier@....samsung.com>,
Jon Hunter <jonathanh@...dia.com>, Dmitry Baryshkov <lumag@...nel.org>,
Oleksij Rempel <o.rempel@...gutronix.de>
Cc: Peter Griffin <peter.griffin@...aro.org>,
Tudor Ambarus <tudor.ambarus@...aro.org>,
Will McVicker <willmcvicker@...gle.com>, Juan Yescas <jyescas@...gle.com>,
kernel-team@...roid.com, linux-kernel@...r.kernel.org,
André Draszik <andre.draszik@...aro.org>
Subject: [PATCH 5/8] regulator: core: remove dead code in
regulator_resolve_supply()
Since commit 98e48cd9283d ("regulator: core: resolve supply for
boot-on/always-on regulators") we require that a regulator's supply has
been resolved before enabling the regulator. Furthermore,
regulator_get() also fails if the supply hasn't been resolved yet
(preventing consumers from enabling a regulator without its supply
known). In combination this means that regulator_resolve_supply() now
always runs before the regulator has been enabled via
set_machine_constraints().
The code here was meant to run after enabling the regulator in case the
supply hadn't been resolved at that time and can therefore never
execute anymore since that commit.
Remove it.
No functional change intended.
Fixes: 98e48cd9283d ("regulator: core: resolve supply for boot-on/always-on regulators")
Signed-off-by: André Draszik <andre.draszik@...aro.org>
---
drivers/regulator/core.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 08bdb1e4175e6d47d154e7a2d859a9d39dcfd021..fd8da369c0529da12d6e80d90032e07bed414316 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2282,28 +2282,6 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
/* rdev->supply was created in set_supply() */
link_and_create_debugfs(rdev->supply, r, &rdev->dev);
- /*
- * In set_machine_constraints() we may have turned this regulator on
- * but we couldn't propagate to the supply if it hadn't been resolved
- * yet. Do it now.
- */
- if (rdev->use_count) {
- ret = regulator_enable(rdev->supply);
- if (ret < 0) {
- struct regulator *supply;
-
- regulator_lock_two(rdev, rdev->supply->rdev, &ww_ctx);
-
- supply = rdev->supply;
- rdev->supply = NULL;
-
- regulator_unlock_two(rdev, supply->rdev, &ww_ctx);
-
- regulator_put(supply);
- goto out;
- }
- }
-
out:
return ret;
}
--
2.52.0.351.gbe84eed79e-goog
Powered by blists - more mailing lists