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

Commit 668dd86b authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Anirudh Ghayal
Browse files

power: qpnp-fg: Do not return -EAGAIN when handling IMA error during probe



Currently, when an IMA error is seen while doing a SRAM access
driver returns -EAGAIN. This is fine as such however this can
cause a failure during probe where the error is checked and
handled well before SRAM access can be made. Fix this.

Change-Id: I461d185ffcf9aaccbf29d5dc484f74af20d16712
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent dedb3ae3
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
/* Copyright (c) 2014-2018, The Linux Foundation. All rights reserved.
/* Copyright (c) 2014-2019, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -1341,10 +1341,15 @@ static int fg_check_ima_exception(struct fg_chip *chip, bool check_hw_sts)

	if (run_err_clr_seq) {
		ret = fg_run_iacs_clear_sequence(chip);
		if (!ret)
			return -EAGAIN;
		else
		if (ret) {
			pr_err("Error clearing IMA exception ret=%d\n", ret);
			return ret;
		}

		if (check_hw_sts)
			return 0;
		else
			return -EAGAIN;
	}

	return rc;