From dcd02f784826690ce0752080600013b051f6de0c Mon Sep 17 00:00:00 2001 From: David Collins Date: Mon, 23 May 2016 16:39:45 -0700 Subject: [PATCH] regulator: cpr3-regulator: correct CPR aging cleanup handling Correct the condition checked in the CPR aging error cleanup path so that a return code of 0 (success) is not returned when the aging measurement fails. Also, correct the order of the arguments in the aging failure error message. Change-Id: Ica925da95b5ab35f63bb0355470475733080a88c CRs-Fixed: 1061372 Signed-off-by: David Collins --- drivers/regulator/cpr3-regulator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/regulator/cpr3-regulator.c b/drivers/regulator/cpr3-regulator.c index 9e400a9eee5c..466c96eff806 100644 --- a/drivers/regulator/cpr3-regulator.c +++ b/drivers/regulator/cpr3-regulator.c @@ -3523,7 +3523,7 @@ cleanup: if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPR4) { rc2 = cpr3_ctrl_clear_cpr4_config(ctrl); - if (rc) { + if (rc2) { cpr3_err(ctrl, "failed to clear CPR4 configuration,rc=%d\n", rc2); rc = rc2; @@ -3798,7 +3798,7 @@ static int cpr3_regulator_aging_adjust(struct cpr3_controller *ctrl) max_aging_volt = max(max_aging_volt, aging_volt); } else { cpr3_err(ctrl, "CPR aging measurement failed after %d tries, rc=%d\n", - rc, CPR3_AGING_RETRY_COUNT); + j, rc); ctrl->aging_failed = true; ctrl->aging_required = false; goto cleanup;