linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume()
@ 2022-06-23  7:02 Peng Wu
  2022-06-23  8:51 ` Matthias Brugger
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Wu @ 2022-06-23  7:02 UTC (permalink / raw)
  To: matthias.bgg
  Cc: linux-arm-kernel, linux-mediatek, linux-kernel, liwei391, wupeng58

Fix the missing clk_disable_unprepare() before return
from svs_resume() in the error handling case.

Signed-off-by: Peng Wu <wupeng58@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
---
v2:
- Same holds for the error path of svs_init02().
---
 drivers/soc/mediatek/mtk-svs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 606a00a2e57d..87e05ab51552 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -1526,16 +1526,20 @@ static int svs_resume(struct device *dev)
 	ret = reset_control_deassert(svsp->rst);
 	if (ret) {
 		dev_err(svsp->dev, "cannot deassert reset %d\n", ret);
-		return ret;
+		goto out_of_resume;
 	}
 
 	ret = svs_init02(svsp);
 	if (ret)
-		return ret;
+		goto out_of_resume;
 
 	svs_mon_mode(svsp);
 
 	return 0;
+
+out_of_resume:
+	clk_disable_unprepare(svsp->main_clk);
+	return ret;
 }
 
 static int svs_bank_resource_setup(struct svs_platform *svsp)
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume()
  2022-06-23  7:02 [PATCH v2] soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume() Peng Wu
@ 2022-06-23  8:51 ` Matthias Brugger
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Brugger @ 2022-06-23  8:51 UTC (permalink / raw)
  To: Peng Wu; +Cc: linux-arm-kernel, linux-mediatek, linux-kernel, liwei391



On 23/06/2022 09:02, Peng Wu wrote:
> Fix the missing clk_disable_unprepare() before return
> from svs_resume() in the error handling case.
> 
> Signed-off-by: Peng Wu <wupeng58@huawei.com>
> Reported-by: Hulk Robot <hulkci@huawei.com>

Applied, thanks!

> ---
> v2:
> - Same holds for the error path of svs_init02().
> ---
>   drivers/soc/mediatek/mtk-svs.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index 606a00a2e57d..87e05ab51552 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -1526,16 +1526,20 @@ static int svs_resume(struct device *dev)
>   	ret = reset_control_deassert(svsp->rst);
>   	if (ret) {
>   		dev_err(svsp->dev, "cannot deassert reset %d\n", ret);
> -		return ret;
> +		goto out_of_resume;
>   	}
>   
>   	ret = svs_init02(svsp);
>   	if (ret)
> -		return ret;
> +		goto out_of_resume;
>   
>   	svs_mon_mode(svsp);
>   
>   	return 0;
> +
> +out_of_resume:
> +	clk_disable_unprepare(svsp->main_clk);
> +	return ret;
>   }
>   
>   static int svs_bank_resource_setup(struct svs_platform *svsp)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-23  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-23  7:02 [PATCH v2] soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume() Peng Wu
2022-06-23  8:51 ` Matthias Brugger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).