aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Ni <[email protected]>2024-06-28 11:35:08 +0800
committerWim Van Sebroeck <[email protected]>2024-07-10 20:01:30 +0200
commit9dca7a0ae50c9cff5c510aeb6587f92e530fd1fe (patch)
tree234b36d85a817a4d88958c925469faa4f8cecfbd
parentd794a7410177f05b05232fc8cac46db196eafb00 (diff)
watchdog: starfive: Add missing clk_disable_unprepare()
Add the missing clk_disable_unprepare() before return in starfive_wdt_enable_clock(). Signed-off-by: Chen Ni <[email protected]> Reviewed-by: Xingyu Wu <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
-rw-r--r--drivers/watchdog/starfive-wdt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/watchdog/starfive-wdt.c b/drivers/watchdog/starfive-wdt.c
index b4b059883618..19a2620d3d38 100644
--- a/drivers/watchdog/starfive-wdt.c
+++ b/drivers/watchdog/starfive-wdt.c
@@ -152,8 +152,10 @@ static int starfive_wdt_enable_clock(struct starfive_wdt *wdt)
return dev_err_probe(wdt->wdd.parent, ret, "failed to enable apb clock\n");
ret = clk_prepare_enable(wdt->core_clk);
- if (ret)
+ if (ret) {
+ clk_disable_unprepare(wdt->apb_clk);
return dev_err_probe(wdt->wdd.parent, ret, "failed to enable core clock\n");
+ }
return 0;
}