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

Commit 1100fbab authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: qpnp-qg: Fix the return error check in QGauge



ADC reads over IIO return positive value on success.
Fix the return error check.

Change-Id: Ib8eb1ab3f7f9f3f0f3d5d717fc02b87669125556
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent e8329f96
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2394,7 +2394,7 @@ static int get_batt_id_ohm(struct qpnp_qg *chip, u32 *batt_id_ohm)

	/* Read battery-id */
	rc = iio_read_channel_processed(chip->batt_id_chan, &batt_id_mv);
	if (rc) {
	if (rc < 0) {
		pr_err("Failed to read BATT_ID over ADC, rc=%d\n", rc);
		return rc;
	}
@@ -2573,7 +2573,7 @@ static int qg_determine_pon_soc(struct qpnp_qg *chip)
use_pon_ocv:
	if (use_pon_ocv == true) {
		rc = qg_get_battery_temp(chip, &batt_temp);
		if (rc) {
		if (rc < 0) {
			pr_err("Failed to read BATT_TEMP at PON rc=%d\n", rc);
			goto done;
		}