From: Chuhong Yuan Date: Thu, 5 Dec 2019 16:06:55 +0000 (+0800) Subject: rtc: stm32: add missed clk_disable_unprepare in error path of resume X-Git-Tag: v5.6-rc1~71^2~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf33e911f500f6e628f283e101c0240c79e0b5da;p=thirdparty%2Fkernel%2Fstable.git rtc: stm32: add missed clk_disable_unprepare in error path of resume The resume() forgets to call clk_disable_unprepare() when failed. Add the missed call to fix it. Signed-off-by: Chuhong Yuan Reviewed-by: Amelie Delaunay Link: https://lore.kernel.org/r/20191205160655.32188-1-hslester96@gmail.com Signed-off-by: Alexandre Belloni --- diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c index 781cabb2afca4..d774aa18f57a5 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);