Skip to content

Commit bdbdc4b

Browse files
andredbroonie
authored andcommitted
regulator: core: remove dead code in regulator_resolve_supply()
Since commit 98e48cd ("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. Signed-off-by: André Draszik <andre.draszik@linaro.org> Link: https://patch.msgid.link/20260109-regulators-defer-v2-5-1a25dc968e60@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 4f3323b commit bdbdc4b

1 file changed

Lines changed: 0 additions & 22 deletions

File tree

drivers/regulator/core.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2282,28 +2282,6 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
22822282
/* rdev->supply was created in set_supply() */
22832283
link_and_create_debugfs(rdev->supply, r, &rdev->dev);
22842284

2285-
/*
2286-
* In set_machine_constraints() we may have turned this regulator on
2287-
* but we couldn't propagate to the supply if it hadn't been resolved
2288-
* yet. Do it now.
2289-
*/
2290-
if (rdev->use_count) {
2291-
ret = regulator_enable(rdev->supply);
2292-
if (ret < 0) {
2293-
struct regulator *supply;
2294-
2295-
regulator_lock_two(rdev, rdev->supply->rdev, &ww_ctx);
2296-
2297-
supply = rdev->supply;
2298-
rdev->supply = NULL;
2299-
2300-
regulator_unlock_two(rdev, supply->rdev, &ww_ctx);
2301-
2302-
regulator_put(supply);
2303-
goto out;
2304-
}
2305-
}
2306-
23072285
out:
23082286
return ret;
23092287
}

0 commit comments

Comments
 (0)