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 <fabiobaltieri@google.com>
This commit is contained in:
parent
2147eefa15
commit
843f66f52d
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include <zephyr/kernel.h>
|
||||
#include <zephyr/arch/cpu.h>
|
||||
#include <zephyr/init.h>
|
||||
#include <zephyr/device.h>
|
||||
#include <soc.h>
|
||||
|
||||
#include <zephyr/sw_isr_table.h>
|
||||
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue