From e9a67aabf77ee03e2fae7fd68d9fc2c51d9e6a87 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Fri, 15 Sep 2023 10:33:24 +0000 Subject: [PATCH] intc: swerv_pic: convert SYS_INIT to DEVICE_DT_INST_DEFINE Convert SYS_INIT to DEVICE_DT_INST_DEFINE, this allows the build system to track the device dependencies and ensure that the interrupt controller is initialized before other devices using it. Signed-off-by: Fabio Baltieri --- drivers/interrupt_controller/intc_swerv_pic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/interrupt_controller/intc_swerv_pic.c b/drivers/interrupt_controller/intc_swerv_pic.c index 65266cf8f9f..5c52ab49614 100644 --- a/drivers/interrupt_controller/intc_swerv_pic.c +++ b/drivers/interrupt_controller/intc_swerv_pic.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -143,7 +143,7 @@ static void swerv_pic_irq_handler(const void *arg) swerv_pic_write(SWERV_PIC_meigwclr(irq), 0); } -static int swerv_pic_init(void) +static int swerv_pic_init(const struct device *dev) { int i; @@ -236,4 +236,5 @@ int arch_irq_is_enabled(unsigned int irq) return !!(mie & (1 << irq)); } -SYS_INIT(swerv_pic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY); +DEVICE_DT_INST_DEFINE(0, swerv_pic_init, NULL, NULL, NULL, + PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);