diff mbox series

remoteproc/mediatek: unprepare clk if scp_before_load fails

Message ID 20201202044537.2500497-1-tzungbi@google.com (mailing list archive)
State New, archived
Headers show
Series remoteproc/mediatek: unprepare clk if scp_before_load fails | expand

Commit Message

Tzung-Bi Shih Dec. 2, 2020, 4:45 a.m. UTC
Fixes the error handling to unprepare clk if scp_before_load fails.

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

Comments

Mathieu Poirier Dec. 2, 2020, 8:35 p.m. UTC | #1
On Wed, Dec 02, 2020 at 12:45:37PM +0800, Tzung-Bi Shih wrote:
> Fixes the error handling to unprepare clk if scp_before_load fails.
> 

This requires a "Fixes:" tag.

> Signed-off-by: Tzung-Bi Shih <tzungbi@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);
> -

Unneeded change

Thanks,
Mathieu

>  	return ret;
>  }
>  
> -- 
> 2.29.2.454.gaff20da3a2-goog
>
diff mbox series

Patch

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;
 }