Skip to content

Commit

Permalink
drivers: watchdog: npcm4xx: check dts node status
Browse files Browse the repository at this point in the history
check dts node status.

Signed-off-by: James Chiang <[email protected]>
  • Loading branch information
James Chiang committed Oct 24, 2024
1 parent ca86f09 commit c9cf7b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions boards/arm/npcm400f_evb/npcm400f_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
current-speed = <115200>;
};

&twd0 {
status = "okay";
};

&peci0 {
status = "okay";
pinctrl-0 = <&pinctrl_peci0_default>;
Expand Down
13 changes: 8 additions & 5 deletions drivers/watchdog/wdt_npcm4xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,11 @@ static const struct wdt_driver_api wdt_npcm4xx_driver_api = {
.feed = wdt_npcm4xx_feed,
};

DEVICE_DT_INST_DEFINE(0, wdt_npcm4xx_init, NULL,
&wdt_npcm4xx_data_0, &wdt_npcm4xx_cfg_0,
PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&wdt_npcm4xx_driver_api);
#define NPCM4XX_WDT_INIT(inst) \
DEVICE_DT_INST_DEFINE(inst, wdt_npcm4xx_init, NULL, \
&wdt_npcm4xx_data_##inst, &wdt_npcm4xx_cfg_##inst, \
PRE_KERNEL_1, \
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, \
&wdt_npcm4xx_driver_api);

DT_INST_FOREACH_STATUS_OKAY(NPCM4XX_WDT_INIT)

0 comments on commit c9cf7b1

Please sign in to comment.