drivers: watchdog: Convert drivers to new DT device macros
Convert watchdog drivers to use new DT variants of the DEVICE APIs. DEVICE_AND_API_INIT -> DEVICE_DT_DEFINE DEVICE_GET -> DEVICE_DT_GET DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE etc.. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
f105455ebe
commit
e376b9417b
13 changed files with 41 additions and 37 deletions
|
@ -38,7 +38,7 @@ struct wdt_sam0_dev_data {
|
|||
bool timeout_valid;
|
||||
};
|
||||
|
||||
DEVICE_DECLARE(wdt_sam0);
|
||||
DEVICE_DT_INST_DECLARE(0);
|
||||
|
||||
static struct wdt_sam0_dev_data wdt_sam0_data = { 0 };
|
||||
|
||||
|
@ -272,7 +272,7 @@ static int wdt_sam0_init(const struct device *dev)
|
|||
|
||||
IRQ_CONNECT(DT_INST_IRQN(0),
|
||||
DT_INST_IRQ(0, priority), wdt_sam0_isr,
|
||||
DEVICE_GET(wdt_sam0), 0);
|
||||
DEVICE_DT_INST_GET(0), 0);
|
||||
irq_enable(DT_INST_IRQN(0));
|
||||
|
||||
return 0;
|
||||
|
@ -280,6 +280,6 @@ static int wdt_sam0_init(const struct device *dev)
|
|||
|
||||
static struct wdt_sam0_dev_data wdt_sam0_data;
|
||||
|
||||
DEVICE_AND_API_INIT(wdt_sam0, DT_INST_LABEL(0), wdt_sam0_init,
|
||||
DEVICE_DT_INST_DEFINE(0, wdt_sam0_init, device_pm_control_nop,
|
||||
&wdt_sam0_data, NULL, PRE_KERNEL_1,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &wdt_sam0_api);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue