drivers: watchdog: nordic: move to new DT API
Straightforward API conversion only. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
644f9ecbf0
commit
eca99d810f
|
@ -150,6 +150,8 @@ static void wdt_event_handler(struct device *dev)
|
|||
}
|
||||
}
|
||||
|
||||
#define WDT(idx) DT_NODELABEL(wdt##idx)
|
||||
|
||||
#define WDT_NRFX_WDT_DEVICE(idx) \
|
||||
DEVICE_DECLARE(wdt_##idx); \
|
||||
static void wdt_##idx##_event_handler(void) \
|
||||
|
@ -159,8 +161,7 @@ static void wdt_event_handler(struct device *dev)
|
|||
static int wdt_##idx##_init(struct device *dev) \
|
||||
{ \
|
||||
nrfx_err_t err_code; \
|
||||
IRQ_CONNECT(NRFX_IRQ_NUMBER_GET(NRF_WDT##idx), \
|
||||
DT_NORDIC_NRF_WATCHDOG_WDT_##idx##_IRQ_0_PRIORITY, \
|
||||
IRQ_CONNECT(DT_IRQN(WDT(idx)), DT_IRQ(WDT(idx), priority), \
|
||||
nrfx_isr, nrfx_wdt_##idx##_irq_handler, 0); \
|
||||
err_code = nrfx_wdt_init(&get_dev_config(dev)->wdt, \
|
||||
&get_dev_config(dev)->config, \
|
||||
|
@ -182,7 +183,7 @@ static void wdt_event_handler(struct device *dev)
|
|||
} \
|
||||
}; \
|
||||
DEVICE_AND_API_INIT(wdt_##idx, \
|
||||
DT_NORDIC_NRF_WATCHDOG_WDT_##idx##_LABEL, \
|
||||
DT_LABEL(WDT(idx)), \
|
||||
wdt_##idx##_init, \
|
||||
&wdt_##idx##_data, \
|
||||
&wdt_##idx##z_config, \
|
||||
|
|
Loading…
Reference in a new issue