Commit 8c826bd9 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'regulator-fix-v6.9-merge-window' of...

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
parents 6b571e26 e4ead3cd
...@@ -2274,6 +2274,17 @@ struct regulator *_regulator_get(struct device *dev, const char *id, ...@@ -2274,6 +2274,17 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
if (ret > 0) { if (ret > 0) {
rdev->use_count = 1; rdev->use_count = 1;
regulator->enable_count = 1; regulator->enable_count = 1;
/* Propagate the regulator state to its supply */
if (rdev->supply) {
ret = regulator_enable(rdev->supply);
if (ret < 0) {
destroy_regulator(regulator);
module_put(rdev->owner);
put_device(&rdev->dev);
return ERR_PTR(ret);
}
}
} else { } else {
rdev->use_count = 0; rdev->use_count = 0;
regulator->enable_count = 0; regulator->enable_count = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment