Skip to content

Commit

Permalink
regulator: core: Let boot-on regulators be powered off
Browse files Browse the repository at this point in the history
Boot-on regulators are always kept on because their use_count value
is now incremented at boot time and never cleaned.

Only increment count value for alway-on regulators.
regulator_late_cleanup() is now able to power off boot-on regulators
when unused.

Fixes: 05f224c ("regulator: core: Clean enabling always-on regulators + their supplies")
Signed-off-by: Pascal Paillet <p.paillet@st.com>
Link: https://lore.kernel.org/r/20191113102737.27831-1-p.paillet@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Pascal Paillet authored and Mark Brown committed Nov 15, 2019
1 parent 458ea3a commit 089b3f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,9 @@ static int set_machine_constraints(struct regulator_dev *rdev,
rdev_err(rdev, "failed to enable\n");
return ret;
}
rdev->use_count++;

if (rdev->constraints->always_on)
rdev->use_count++;
}

print_constraints(rdev);
Expand Down

0 comments on commit 089b3f6

Please sign in to comment.