wdt: dw: Enable the clock before using it
The watchdog won't work if the clock isn't enabled.
Fixes: cf89ef8d10
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:

committed by
Leo Yu-Chi Liang

parent
7d8394366a
commit
4cb0ab4ebc
@@ -129,6 +129,10 @@ static int designware_wdt_probe(struct udevice *dev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
ret = clk_enable(&clk);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
priv->clk_khz = clk_get_rate(&clk) / 1000;
|
priv->clk_khz = clk_get_rate(&clk) / 1000;
|
||||||
if (!priv->clk_khz)
|
if (!priv->clk_khz)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
Reference in New Issue
Block a user