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

Commit 82c438d3 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Gerrit - the friendly Code Review server
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 b55100db
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -1979,8 +1979,9 @@ static int qg_charge_full_update(struct qpnp_qg *chip)
	if (rc < 0 || prop.intval < 0) {
	if (rc < 0 || prop.intval < 0) {
		pr_debug("Failed to get recharge-soc\n");
		pr_debug("Failed to get recharge-soc\n");
		recharge_soc = DEFAULT_RECHARGE_SOC;
		recharge_soc = DEFAULT_RECHARGE_SOC;
	}
	} else {
		recharge_soc = prop.intval;
		recharge_soc = prop.intval;
	}
	chip->recharge_soc = recharge_soc;
	chip->recharge_soc = recharge_soc;


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