Skip to content

Commit d567f5d

Browse files
committed
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()
2 parents 754e0b0 + 4e2a354 commit d567f5d

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

drivers/regulator/core.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6014,9 +6014,8 @@ core_initcall(regulator_init);
60146014
static int regulator_late_cleanup(struct device *dev, void *data)
60156015
{
60166016
struct regulator_dev *rdev = dev_to_rdev(dev);
6017-
const struct regulator_ops *ops = rdev->desc->ops;
60186017
struct regulation_constraints *c = rdev->constraints;
6019-
int enabled, ret;
6018+
int ret;
60206019

60216020
if (c && c->always_on)
60226021
return 0;
@@ -6029,14 +6028,8 @@ static int regulator_late_cleanup(struct device *dev, void *data)
60296028
if (rdev->use_count)
60306029
goto unlock;
60316030

6032-
/* If we can't read the status assume it's always on. */
6033-
if (ops->is_enabled)
6034-
enabled = ops->is_enabled(rdev);
6035-
else
6036-
enabled = 1;
6037-
6038-
/* But if reading the status failed, assume that it's off. */
6039-
if (enabled <= 0)
6031+
/* If reading the status failed, assume that it's off. */
6032+
if (_regulator_is_enabled(rdev) <= 0)
60406033
goto unlock;
60416034

60426035
if (have_full_constraints()) {

0 commit comments

Comments
 (0)