diff mbox series

soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume()

Message ID 20220621114658.10054-1-wupeng58@huawei.com (mailing list archive)
State New, archived
Headers show
Series soc: mediatek: fix missing clk_disable_unprepare() on err in svs_resume() | expand

Commit Message

Peng Wu June 21, 2022, 11:46 a.m. UTC
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>
---
 drivers/soc/mediatek/mtk-svs.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Matthias Brugger June 22, 2022, 2:02 p.m. UTC | #1
On 21/06/2022 13:46, 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>
> ---
>   drivers/soc/mediatek/mtk-svs.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
> index 606a00a2e57d..1b5c297aaec5 100644
> --- a/drivers/soc/mediatek/mtk-svs.c
> +++ b/drivers/soc/mediatek/mtk-svs.c
> @@ -1525,6 +1525,7 @@ static int svs_resume(struct device *dev)
>   
>   	ret = reset_control_deassert(svsp->rst);
>   	if (ret) {
> +		clk_disable_unprepare(svsp->main_clk);

Same holds for the error path of svs_init02(), correct?

Regards,
Matthias

>   		dev_err(svsp->dev, "cannot deassert reset %d\n", ret);
>   		return ret;
>   	}
Peng Wu June 23, 2022, 6:50 a.m. UTC | #2
On 2022/6/22 22:02, Matthias Brugger wrote:
> 
> 
> On 21/06/2022 13:46, 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>
>> ---
>>   drivers/soc/mediatek/mtk-svs.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
>> index 606a00a2e57d..1b5c297aaec5 100644
>> --- a/drivers/soc/mediatek/mtk-svs.c
>> +++ b/drivers/soc/mediatek/mtk-svs.c
>> @@ -1525,6 +1525,7 @@ static int svs_resume(struct device *dev)
>>       ret = reset_control_deassert(svsp->rst);
>>       if (ret) {
>> +        clk_disable_unprepare(svsp->main_clk);
> 
> Same holds for the error path of svs_init02(), correct?
> 
> Regards,
> Matthias
> 
>>           dev_err(svsp->dev, "cannot deassert reset %d\n", ret);
>>           return ret;
>>       }
> .
Yes, the error path of svs_init02() requires the same operation.
I will resubmit a patch.

Regards,
Peng
diff mbox series

Patch

diff --git a/drivers/soc/mediatek/mtk-svs.c b/drivers/soc/mediatek/mtk-svs.c
index 606a00a2e57d..1b5c297aaec5 100644
--- a/drivers/soc/mediatek/mtk-svs.c
+++ b/drivers/soc/mediatek/mtk-svs.c
@@ -1525,6 +1525,7 @@  static int svs_resume(struct device *dev)
 
 	ret = reset_control_deassert(svsp->rst);
 	if (ret) {
+		clk_disable_unprepare(svsp->main_clk);
 		dev_err(svsp->dev, "cannot deassert reset %d\n", ret);
 		return ret;
 	}