summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Troast <ntroast@codeaurora.org>2017-07-24 14:40:56 -0700
committerNicholas Troast <ntroast@codeaurora.org>2017-07-31 09:35:04 -0700
commit95f429cba231e57e31f5657b61b61dd65c83bfb2 (patch)
tree96ec2deb62686b2a1f03320544f6a144278fe826
parent02c043ee884ad83717ddd178260a8bdeabc4b798 (diff)
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>
-rw-r--r--drivers/power/supply/qcom/pmic-voter.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/power/supply/qcom/pmic-voter.c b/drivers/power/supply/qcom/pmic-voter.c
index b99558ed2100..f8134d1823be 100644
--- a/drivers/power/supply/qcom/pmic-voter.c
+++ b/drivers/power/supply/qcom/pmic-voter.c
@@ -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;