lkml.org 
[lkml]   [2019]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume
From
Date
On 12/5/19 5:06 PM, Chuhong Yuan wrote:
> The resume() forgets to call clk_disable_unprepare() when failed.
> Add the missed call to fix it.
>
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> drivers/rtc/rtc-stm32.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c
> index 781cabb2afca..d774aa18f57a 100644
> --- a/drivers/rtc/rtc-stm32.c
> +++ b/drivers/rtc/rtc-stm32.c
> @@ -897,8 +897,11 @@ static int stm32_rtc_resume(struct device *dev)
> }
>
> ret = stm32_rtc_wait_sync(rtc);
> - if (ret < 0)
> + if (ret < 0) {
> + if (rtc->data->has_pclk)
> + clk_disable_unprepare(rtc->pclk);
> return ret;
> + }
>
> if (device_may_wakeup(dev))
> return disable_irq_wake(rtc->irq_alarm);
>

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>

\
 
 \ /
  Last update: 2019-12-06 09:21    [W:0.033 / U:1.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site