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

Commit 52b4c8ed authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

regulator: msm-gfx-ldo: Disable CX only in the error path



Disable the regulator vote on CX only if there is failure,
also check if the regulator handle is valid.

Change-Id: I8cbb8aad3c99d0a619dfeb2f68873c39316f0158
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 01bc6588
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -365,9 +365,11 @@ static int msm_gfx_ldo_enable(struct regulator_dev *rdev)
	ldo_vreg->vreg_enabled = true;

disable_cx:
	if (rc && ldo_vreg->vdd_cx) {
		rc = regulator_disable(ldo_vreg->vdd_cx);
		if (rc)
			pr_err("regulator_enable: vdd_cx: failed rc=%d\n", rc);
	}
fail:
	mutex_unlock(&ldo_vreg->ldo_mutex);
	return rc;