diff options
Diffstat (limited to 'zephyr/shim/src/watchdog.c')
-rw-r--r-- | zephyr/shim/src/watchdog.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/zephyr/shim/src/watchdog.c b/zephyr/shim/src/watchdog.c index 13d380bfcb..2895868757 100644 --- a/zephyr/shim/src/watchdog.c +++ b/zephyr/shim/src/watchdog.c @@ -26,9 +26,9 @@ int watchdog_init(void) const struct device *wdt; struct wdt_timeout_cfg wdt_config; - wdt = device_get_binding(DT_LABEL(DT_NODELABEL(twd0))); - if (!wdt) { - LOG_ERR("Watchdog get binding failed"); + wdt = DEVICE_DT_GET(DT_NODELABEL(twd0)); + if (!device_is_ready(wdt)) { + LOG_ERR("Error: device %s is not ready", wdt->name); return -1; } @@ -62,11 +62,9 @@ void watchdog_reload(void) { const struct device *wdt; - wdt = device_get_binding(DT_LABEL(DT_NODELABEL(twd0))); - if (!wdt) { - LOG_ERR("Watchdog get binding failed"); - return; - } + wdt = DEVICE_DT_GET(DT_NODELABEL(twd0)); + if (!device_is_ready(wdt)) + LOG_ERR("Error: device %s is not ready", wdt->name); wdt_feed(wdt, 0); } |