[PATCH v2] remoteproc/mediatek: unprepare clk if scp_before_load fails
Mathieu Poirier
mathieu.poirier at linaro.org
Thu Dec 3 10:33:38 EST 2020
On Thu, Dec 03, 2020 at 11:04:36AM +0800, Tzung-Bi Shih wrote:
> Fixes the error handling to unprepare clk if scp_before_load fails.
>
> Fixes: fd0b6c1ff85a4 ("remoteproc/mediatek: Add support for mt8192 SCP")
https://elixir.bootlin.com/linux/v5.10-rc6/source/Documentation/process/submitting-patches.rst#L122
> Signed-off-by: Tzung-Bi Shih <tzungbi at google.com>
> ---
> Changes from v1[1]:
> - add "Fixes" tag
> - remove an unneeded change
>
> [1]: https://patchwork.kernel.org/project/linux-remoteproc/patch/20201202044537.2500497-1-tzungbi@google.com/
>
> drivers/remoteproc/mtk_scp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c
> index 5f42b9ce7185..5e5705fe35a8 100644
> --- a/drivers/remoteproc/mtk_scp.c
> +++ b/drivers/remoteproc/mtk_scp.c
> @@ -350,9 +350,10 @@ 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-mediatek
mailing list