[PATCH] remoteproc/mediatek: unprepare clk if scp_before_load fails

Tzung-Bi Shih tzungbi at google.com
Tue Dec 1 23:45:37 EST 2020


Fixes the error handling to unprepare clk if scp_before_load fails.

Signed-off-by: Tzung-Bi Shih <tzungbi at google.com>
---
 drivers/remoteproc/mtk_scp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
index 5f42b9ce7185..c7d49c861adb 100644
--- a/drivers/remoteproc/mtk_scp.c
+++ b/drivers/remoteproc/mtk_scp.c
@@ -350,11 +350,11 @@ static int scp_load(struct rproc *rproc, const struct firmware *fw)
 
 	ret = scp->data->scp_before_load(scp);
 	if (ret < 0)
-		return ret;
+		goto leave;
 
 	ret = scp_elf_load_segments(rproc, fw);
+leave:
 	clk_disable_unprepare(scp->clk);
-
 	return ret;
 }
 
-- 
2.29.2.454.gaff20da3a2-goog




More information about the linux-arm-kernel mailing list