diff mbox series

[1/3] watchdog: omap_wdt: Fix WDT timeout configuration

Message ID 20200124044425.469550-1-marex@denx.de
State Accepted
Commit 8a9ec4dd5f0fe3f221721a94cdc45a2a6edb5927
Headers show
Series [1/3] watchdog: omap_wdt: Fix WDT timeout configuration | expand

Commit Message

Marek Vasut Jan. 24, 2020, 4:44 a.m. UTC
The timeout parameter of omap3_wdt_start() is in miliseconds, while
GET_WLDR_VAL() expects parameter in seconds. Fix this so the WDT
driver is actually usable.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Grygorii Strashko <grygorii.strashko at ti.com>
Cc: Sam Protsenko <semen.protsenko at linaro.org>
Cc: Suniel Mahesh <sunil.m at techveda.org>
---
 drivers/watchdog/omap_wdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c
index 284cfbb2a8..b9cdf70036 100644
--- a/drivers/watchdog/omap_wdt.c
+++ b/drivers/watchdog/omap_wdt.c
@@ -188,7 +188,7 @@  static int omap3_wdt_stop(struct udevice *dev)
 static int omap3_wdt_start(struct udevice *dev, u64 timeout_ms, ulong flags)
 {
 	struct omap3_wdt_priv *priv = dev_get_priv(dev);
-	u32 pre_margin = GET_WLDR_VAL(timeout_ms);
+	u32 pre_margin = GET_WLDR_VAL(timeout_ms / 1000);
 /*
  * Make sure the watchdog is disabled. This is unfortunately required
  * because writing to various registers with the watchdog running has no