power: pmic-voter: use force_val in rerun election

If force_val is used it can be overwritten by rerun election. Fix this
by getting the effective result which takes the force_val into
consideration.

Change-Id: I2d52d0b2cad1d515efaa103187e7197fe78cc106
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
This commit is contained in:
Nicholas Troast 2017-07-24 14:40:56 -07:00
parent 02c043ee88
commit 95f429cba2

View file

@ -438,12 +438,14 @@ out:
int rerun_election(struct votable *votable)
{
int rc = 0;
int effective_result;
lock_votable(votable);
effective_result = get_effective_result_locked(votable);
if (votable->callback)
rc = votable->callback(votable,
votable->data,
votable->effective_result,
votable->data,
effective_result,
get_client_str(votable, votable->effective_client_id));
unlock_votable(votable);
return rc;