From 6fbe62bdb5aa9061a03e6776ef0ec64832ae7469 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Fri, 15 Sep 2023 10:03:40 +0000 Subject: [PATCH] intc: arcv2: 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_arcv2_irq_unit.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/interrupt_controller/intc_arcv2_irq_unit.c b/drivers/interrupt_controller/intc_arcv2_irq_unit.c index 5c06d936893..8825e1a7345 100644 --- a/drivers/interrupt_controller/intc_arcv2_irq_unit.c +++ b/drivers/interrupt_controller/intc_arcv2_irq_unit.c @@ -19,7 +19,9 @@ #include #include #include -#include +#include + +#define DT_DRV_COMPAT snps_arcv2_intc #ifdef CONFIG_ARC_CONNECT static void arc_shared_intc_init(void) @@ -134,7 +136,7 @@ void arc_core_private_intc_init(void) #endif /* CONFIG_ARC_CONNECT */ } -static int arc_irq_init(void) +static int arc_irq_init(const struct device *dev) { #ifdef CONFIG_ARC_CONNECT arc_shared_intc_init(); @@ -149,4 +151,5 @@ static int arc_irq_init(void) return 0; } -SYS_INIT(arc_irq_init, PRE_KERNEL_1, 0); +DEVICE_DT_INST_DEFINE(0, arc_irq_init, NULL, NULL, NULL, + PRE_KERNEL_1, 0, NULL);