Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 05f224ca6693 ("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>

authored by

Pascal Paillet and committed by
Mark Brown
089b3f61 458ea3ad

+3 -1
+3 -1
drivers/regulator/core.c
··· 1403 1403 rdev_err(rdev, "failed to enable\n"); 1404 1404 return ret; 1405 1405 } 1406 - rdev->use_count++; 1406 + 1407 + if (rdev->constraints->always_on) 1408 + rdev->use_count++; 1407 1409 } 1408 1410 1409 1411 print_constraints(rdev);