diff mbox series

[v2,4/7] wdt: dw: Enable the clock before using it

Message ID 20200807150355.287181-4-seanga2@gmail.com
State New
Delegated to: Marek Vasut
Headers show
Series [v2,1/7] wdt: dw: Switch to using fls for log2 | expand

Commit Message

Sean Anderson Aug. 7, 2020, 3:03 p.m. UTC
The watchdog won't work if the clock isn't enabled.

Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6
Signed-off-by: Sean Anderson <seanga2@gmail.com>
---

(no changes since v1)

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

Patch

diff --git a/drivers/watchdog/designware_wdt.c b/drivers/watchdog/designware_wdt.c
index 41866fa01b..e6f5437056 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;