]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
wdt: dw: Enable the clock before using it
authorSean Anderson <seanga2@gmail.com>
Thu, 11 Mar 2021 02:02:19 +0000 (21:02 -0500)
committerLeo Yu-Chi Liang <ycliang@andestech.com>
Thu, 8 Apr 2021 07:37:27 +0000 (15:37 +0800)
The watchdog won't work if the clock isn't enabled.

Fixes: cf89ef8d10f240554541c20b2e1bdcdd58d1d7e6
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/watchdog/designware_wdt.c

index a65487d4f3435c7fd873bf7bf015e38aae12178a..709a67fbc340b644b084d02af6edb9070e2fe0e0 100644 (file)
@@ -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;