intc: irqmp: 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 09:49:43 +00:00 committed by Carles Cufí
parent 843f66f52d
commit 1539ca906e

View file

@ -17,7 +17,7 @@
#define DT_DRV_COMPAT gaisler_irqmp
#include <zephyr/kernel.h>
#include <zephyr/init.h>
#include <zephyr/device.h>
/*
* Register description for IRQMP and IRQAMP interrupt controllers
@ -108,7 +108,7 @@ int z_sparc_int_get_source(int irl)
return source;
}
static int irqmp_init(void)
static int irqmp_init(const struct device *dev)
{
volatile struct irqmp_regs *regs = get_irqmp_regs();
@ -121,4 +121,5 @@ static int irqmp_init(void)
return 0;
}
SYS_INIT(irqmp_init, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY);
DEVICE_DT_INST_DEFINE(0, irqmp_init, NULL, NULL, NULL,
PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);