Skip to content

Commit

Permalink
drivers: wdt_tco: Use DT_DRV_COMPAT interface
Browse files Browse the repository at this point in the history
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 <andrei.emeltchenko@intel.com>
  • Loading branch information
finikorg authored and carlescufi committed Sep 25, 2023
1 parent 029e756 commit 11f0e59
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/watchdog/wdt_tco.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);

0 comments on commit 11f0e59

Please sign in to comment.