regulator: core: Propagate the regulator state in case of exclusive get
authorKory Maincent <kory.maincent@bootlin.com>
Tue, 12 Mar 2024 09:16:38 +0000 (10:16 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 12 Mar 2024 13:55:57 +0000 (13:55 +0000)
commite4ead3cdfd798092288f3a06b405cf98ded6fa10
tree456fc66eb1e16b2d8b879cdcb2d7d342b29076d8
parente6f0b08a036734552628ab788ecb528ca53814ab
regulator: core: Propagate the regulator state in case of exclusive get

Previously, performing an exclusive get on an already-enabled regulator
resulted in inconsistent state initialization between child and parent
regulators. While the child's counts were updated, its parent's counters
remained unaffected.

Consequently, attempting to disable an already-enabled exclusive regulator
triggered unbalanced disables warnings from its parent regulator.

This commit addresses the issue by propagating the enable state to the
parent regulator using a regulator_enable call. This ensures consistent
state management across the regulator hierarchy, preventing warnings!

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://msgid.link/r/20240312091638.1266167-1-kory.maincent@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/core.c