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 <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-09-15 10:03:40 +00:00 committed by Carles Cufí
commit 6fbe62bdb5

View file

@ -19,7 +19,9 @@
#include <zephyr/kernel.h> #include <zephyr/kernel.h>
#include <zephyr/arch/cpu.h> #include <zephyr/arch/cpu.h>
#include <zephyr/device.h> #include <zephyr/device.h>
#include <zephyr/init.h> #include <zephyr/device.h>
#define DT_DRV_COMPAT snps_arcv2_intc
#ifdef CONFIG_ARC_CONNECT #ifdef CONFIG_ARC_CONNECT
static void arc_shared_intc_init(void) static void arc_shared_intc_init(void)
@ -134,7 +136,7 @@ void arc_core_private_intc_init(void)
#endif /* CONFIG_ARC_CONNECT */ #endif /* CONFIG_ARC_CONNECT */
} }
static int arc_irq_init(void) static int arc_irq_init(const struct device *dev)
{ {
#ifdef CONFIG_ARC_CONNECT #ifdef CONFIG_ARC_CONNECT
arc_shared_intc_init(); arc_shared_intc_init();
@ -149,4 +151,5 @@ static int arc_irq_init(void)
return 0; 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);