Commit d567f5db authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'regulator-fix-v5.17-rc4' of...

Merge tag 'regulator-fix-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator

Pull regulator fix from Mark Brown:
 "One fix here, for initialisation of regulators that don't have an
  in_enabled() operation which would mainly impact cases where they
  aren't otherwise used during early setup for some reason"

* tag 'regulator-fix-v5.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
  regulator: core: fix false positive in regulator_late_cleanup()
parents 754e0b0e 4e2a354e
...@@ -6014,9 +6014,8 @@ core_initcall(regulator_init); ...@@ -6014,9 +6014,8 @@ core_initcall(regulator_init);
static int regulator_late_cleanup(struct device *dev, void *data) static int regulator_late_cleanup(struct device *dev, void *data)
{ {
struct regulator_dev *rdev = dev_to_rdev(dev); struct regulator_dev *rdev = dev_to_rdev(dev);
const struct regulator_ops *ops = rdev->desc->ops;
struct regulation_constraints *c = rdev->constraints; struct regulation_constraints *c = rdev->constraints;
int enabled, ret; int ret;
if (c && c->always_on) if (c && c->always_on)
return 0; return 0;
...@@ -6029,14 +6028,8 @@ static int regulator_late_cleanup(struct device *dev, void *data) ...@@ -6029,14 +6028,8 @@ static int regulator_late_cleanup(struct device *dev, void *data)
if (rdev->use_count) if (rdev->use_count)
goto unlock; goto unlock;
/* If we can't read the status assume it's always on. */ /* If reading the status failed, assume that it's off. */
if (ops->is_enabled) if (_regulator_is_enabled(rdev) <= 0)
enabled = ops->is_enabled(rdev);
else
enabled = 1;
/* But if reading the status failed, assume that it's off. */
if (enabled <= 0)
goto unlock; goto unlock;
if (have_full_constraints()) { if (have_full_constraints()) {
......
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