Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a055be83 authored by Nicholas Troast's avatar Nicholas Troast
Browse files

power: pmic-voter: handle scenarios where voter state is invalid



After the voter is initialized and before the first valid vote
is made, the voter state is invalid. Introduce some changes to
accommodate this state:

1. Initialize effective_result and all client states to -EINVAL.
2. If the current vote does not change effective_result, or if
   there are no valid votes in the array, skip the callback and
   maintain the current effective result.
3. Allow the user to provide a default_value, which is returned
   in the scenario where the effective_result is queried before
   making a valid vote.

CRs-Fixed: 927044
Change-Id: Ic00064d95e5a9234bcf44a415ad2bbff6e84a2f3
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 41747adc
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