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

Commit a34dc132 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Umang Agrawal
Browse files

power: qpnp-qg: Fix assignment of recharge_soc



Recharge-soc may get assigned to a random value if
the property is missing. Fix this.

Change-Id: I862545b7f4930bb42e37ec36d0558eb8a5c3cefd
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 38c2d8d2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2012,8 +2012,9 @@ static int qg_charge_full_update(struct qpnp_qg *chip)
	if (rc < 0 || prop.intval < 0) {
		pr_debug("Failed to get recharge-soc\n");
		recharge_soc = DEFAULT_RECHARGE_SOC;
	}
	} else {
		recharge_soc = prop.intval;
	}
	chip->recharge_soc = recharge_soc;

	qg_dbg(chip, QG_DEBUG_STATUS, "msoc=%d health=%d charge_full=%d charge_done=%d\n",