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

Commit d681c8e7 authored by Xu Kai's avatar Xu Kai
Browse files

power: qpnp-bms: fix unbalanced IRQs in qpnp-bms.c



In qpnp-bms.c there is a bug where IRQs are getting used
before being registered. Hence, bms_request_irqs() needs
to be moved before battery_insertion_check().

CRs-fixed: 596174
Change-Id: I74c2aa9e14495c22b3cdaa1a3d1f712f9b3cabf6
Signed-off-by: default avatarXu Kai <kaixu@codeaurora.org>
parent e6fc5c6d
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -4308,6 +4308,12 @@ static int qpnp_bms_probe(struct spmi_device *spmi)
		goto error_setup;
	}

	rc = bms_request_irqs(chip);
	if (rc) {
		pr_err("error requesting bms irqs, rc = %d\n", rc);
		goto error_setup;
	}

	battery_insertion_check(chip);
	batfet_status_check(chip);
	battery_status_check(chip);
@@ -4341,12 +4347,6 @@ static int qpnp_bms_probe(struct spmi_device *spmi)
		goto unregister_dc;
	}

	rc = bms_request_irqs(chip);
	if (rc) {
		pr_err("error requesting bms irqs, rc = %d\n", rc);
		goto unregister_dc;
	}

	pr_info("probe success: soc =%d vbatt = %d ocv = %d r_sense_uohm = %u warm_reset = %d\n",
			get_prop_bms_capacity(chip), vbatt, chip->last_ocv_uv,
			chip->r_sense_uohm, warm_reset);