summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/watchdog/wdt-uclass.c3
-rw-r--r--include/wdt.h3
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c
index cf1c527473..d9e4dc7cb8 100644
--- a/drivers/watchdog/wdt-uclass.c
+++ b/drivers/watchdog/wdt-uclass.c
@@ -7,6 +7,7 @@
#include <dm.h>
#include <errno.h>
#include <hang.h>
+#include <time.h>
#include <wdt.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
@@ -83,7 +84,7 @@ void watchdog_reset(void)
/* Do not reset the watchdog too often */
now = get_timer(0);
- if (now > next_reset) {
+ if (time_after(now, next_reset)) {
next_reset = now + 1000; /* reset every 1000ms */
wdt_reset(gd->watchdog_dev);
}
diff --git a/include/wdt.h b/include/wdt.h
index 5bcff24ab3..dd83dfdd32 100644
--- a/include/wdt.h
+++ b/include/wdt.h
@@ -130,11 +130,10 @@ static inline int initr_watchdog(void)
}
}
- if (CONFIG_IS_ENABLED(OF_CONTROL)) {
+ if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
timeout = dev_read_u32_default(gd->watchdog_dev, "timeout-sec",
WATCHDOG_TIMEOUT_SECS);
}
-
wdt_start(gd->watchdog_dev, timeout * 1000, 0);
gd->flags |= GD_FLG_WDT_READY;
printf("WDT: Started with%s servicing (%ds timeout)\n",