[PATCH v6 3/6] wdt: dw: Enable the clock before using it

Sean Anderson seanga2 at gmail.com
Thu Mar 11 03:02:19 CET 2021


The watchdog won't work if the clock isn't enabled.

Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6
Signed-off-by: Sean Anderson <seanga2 at gmail.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---

(no changes since v1)

 drivers/watchdog/designware_wdt.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index a65487d4f3..709a67fbc3 100644
--- a/drivers/watchdog/designware_wdt.c
+++ b/drivers/watchdog/designware_wdt.c
@@ -129,6 +129,10 @@ static int designware_wdt_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
+	ret = clk_enable(&clk);
+	if (ret)
+		return ret;
+
 	priv->clk_khz = clk_get_rate(&clk) / 1000;
 	if (!priv->clk_khz)
 		return -EINVAL;
-- 
2.30.1



More information about the U-Boot mailing list