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 <fabiobaltieri@google.com>
This commit is contained in:
Fabio Baltieri 2023-09-08 16:21:34 +00:00 committed by Carles Cufí
commit a1afaa8b47

View file

@ -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);