From 11f0e59d1900dd23fc573e9e53af3b61ef36fc55 Mon Sep 17 00:00:00 2001 From: Andrei Emeltchenko Date: Wed, 16 Aug 2023 14:56:53 +0300 Subject: [PATCH] drivers: wdt_tco: Use DT_DRV_COMPAT interface DT_DRV_COMPAT was unused for this driver. To get a node identifier DT_NODELABEL() macro was used. Refactor to use the correct interfaces using instance number 0. Signed-off-by: Andrei Emeltchenko --- drivers/watchdog/wdt_tco.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/watchdog/wdt_tco.c b/drivers/watchdog/wdt_tco.c index bc0e95386f2..599871bc5f0 100644 --- a/drivers/watchdog/wdt_tco.c +++ b/drivers/watchdog/wdt_tco.c @@ -11,8 +11,6 @@ LOG_MODULE_REGISTER(wdt_tco, CONFIG_WDT_LOG_LEVEL); -#define TCO_WDT_NODE DT_NODELABEL(tco_wdt) - #define BASE(d) ((struct tco_config *)(d)->config)->base #define TCO_RLD(d) (BASE(d) + 0x00) /* TCO Timer Reload/Curr. Value */ @@ -267,9 +265,9 @@ static struct tco_data wdt_data = { }; static const struct tco_config wdt_config = { - .base = DT_REG_ADDR(TCO_WDT_NODE), + .base = DT_INST_REG_ADDR(0), }; -DEVICE_DT_DEFINE(TCO_WDT_NODE, wdt_init, NULL, &wdt_data, &wdt_config, - POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, - &tco_driver_api); +DEVICE_DT_INST_DEFINE(0, wdt_init, NULL, &wdt_data, &wdt_config, + POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, + &tco_driver_api);