Commit 089b3f61 authored by Pascal Paillet's avatar Pascal Paillet Committed by Mark Brown

regulator: core: Let boot-on regulators be powered off

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: 05f224ca ("regulator: core: Clean enabling always-on regulators + their supplies")
Signed-off-by: default avatarPascal Paillet <p.paillet@st.com>
Link: https://lore.kernel.org/r/20191113102737.27831-1-p.paillet@st.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 458ea3ad
......@@ -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);
......
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