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

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

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: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 106f4889
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -438,12 +438,14 @@ int vote(struct votable *votable, const char *client_str, bool enabled, int val)
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,
			effective_result,
			get_client_str(votable, votable->effective_client_id));
	unlock_votable(votable);
	return rc;