From a1afaa8b478d96ef303f6dd30b7c159e4b3a009a Mon Sep 17 00:00:00 2001 From: Fabio Baltieri Date: Fri, 8 Sep 2023 16:21:34 +0000 Subject: [PATCH] drivers: ioapic: declare the device with DEVICE_DT_INST_DEFINE Use DEVICE_DT_INST_DEFINE instead of DEVICE_DEFINE to declare the device structure. This ensures that the device gets an ordinal and is initialized before any device depending on it. Signed-off-by: Fabio Baltieri --- drivers/interrupt_controller/intc_ioapic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/interrupt_controller/intc_ioapic.c b/drivers/interrupt_controller/intc_ioapic.c index 424f1d5332c..41a6266a699 100644 --- a/drivers/interrupt_controller/intc_ioapic.c +++ b/drivers/interrupt_controller/intc_ioapic.c @@ -543,7 +543,7 @@ static void IoApicRedUpdateLo(unsigned int irq, ioApicRedSetLo(irq, (ioApicRedGetLo(irq) & ~mask) | (value & mask)); } -PM_DEVICE_DEFINE(ioapic, ioapic_pm_action); +PM_DEVICE_DT_INST_DEFINE(0, ioapic_pm_action); -DEVICE_DEFINE(ioapic, "ioapic", ioapic_init, PM_DEVICE_GET(ioapic), NULL, NULL, - PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL); +DEVICE_DT_INST_DEFINE(0, ioapic_init, PM_DEVICE_DT_INST_GET(0), NULL, NULL, + PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY, NULL);