Skip to content

Commit 8c826bd

Browse files
committed
Merge tag 'regulator-fix-v6.9-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
Pull regulator fix from Mark Brown: "One fix that came in during the merge window, fixing a problem with bootstrapping the state of exclusive regulators which have a parent regulator" * tag 'regulator-fix-v6.9-merge-window' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator: regulator: core: Propagate the regulator state in case of exclusive get
2 parents 6b571e2 + e4ead3c commit 8c826bd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/regulator/core.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2274,6 +2274,17 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
22742274
if (ret > 0) {
22752275
rdev->use_count = 1;
22762276
regulator->enable_count = 1;
2277+
2278+
/* Propagate the regulator state to its supply */
2279+
if (rdev->supply) {
2280+
ret = regulator_enable(rdev->supply);
2281+
if (ret < 0) {
2282+
destroy_regulator(regulator);
2283+
module_put(rdev->owner);
2284+
put_device(&rdev->dev);
2285+
return ERR_PTR(ret);
2286+
}
2287+
}
22772288
} else {
22782289
rdev->use_count = 0;
22792290
regulator->enable_count = 0;

0 commit comments

Comments
 (0)