From 843f66f52d2f4d206411de7393cac1b29a4768e4 Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Fri, 15 Sep 2023 09:31:28 +0000 Subject: [PATCH] intc: plic: 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_plic.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/interrupt_controller/intc_plic.c b/drivers/interrupt_controller/intc_plic.c index fe061b89b0a..bbab421d253 100644 --- a/drivers/interrupt_controller/intc_plic.c +++ b/drivers/interrupt_controller/intc_plic.c @@ -14,7 +14,7 @@ #include #include -#include +#include #include #include @@ -210,7 +210,7 @@ static void plic_irq_handler(const void *arg) * * @retval 0 on success. */ -static int plic_init(void) +static int plic_init(const struct device *dev) { volatile uint32_t *en = (volatile uint32_t *)PLIC_IRQ_EN; @@ -247,4 +247,5 @@ static int plic_init(void) return 0; } -SYS_INIT(plic_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY); +DEVICE_DT_INST_DEFINE(0, plic_init, NULL, NULL, NULL, + PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);