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

View file

@ -12,7 +12,7 @@
#include <zephyr/kernel.h>
#include <zephyr/arch/cpu.h>
#include <zephyr/init.h>
#include <zephyr/device.h>
#include <zephyr/sw_isr_table.h>
#include <zephyr/irq.h>
@ -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);