Skip to content
Commit d99fb64a authored by Jonas Karlman's avatar Jonas Karlman Committed by Kever Yang
Browse files

power: regulator: Only run autoset once for each regulator



With the commit 4fcba5d5 ("regulator: implement basic reference
counter"), keeping regulator enablement in balance become more important.
Calling regulator_autoset multiple times on a fixed regulator increase
the enable count for each call, resulting in an unbalanced enable count.

Introduce a AUTOSET_DONE flag and use it to mark that autoset has run
for the regulator. Return -EALREADY on any subsequent call to autoset.

This fixes so that the enable count is only ever increased by one per
regulator for autoset.

Fixes: 4fcba5d5 ("regulator: implement basic reference counter")
Signed-off-by: default avatarJonas Karlman <jonas@kwiboo.se>
Reviewed-by: default avatarKever Yang <kever.yang@rock-chips.com>
parent a9e9445e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment