drivers: interrupt_controller: intc_ioapic: use DEVICE_DT_GET_OR_NULL
The device instance can be obtained at compile time. Here
DEVICE_DT_GET_OR_NULL is used as the following code seems to accept a
NULL condition, meaning instance is optional.
Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
diff --git a/drivers/interrupt_controller/intc_ioapic.c b/drivers/interrupt_controller/intc_ioapic.c
index bb68398..0eb362f 100644
--- a/drivers/interrupt_controller/intc_ioapic.c
+++ b/drivers/interrupt_controller/intc_ioapic.c
@@ -135,7 +135,7 @@
#define DRV_COMPAT_BAK DT_DRV_COMPAT
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT intel_vt_d
- vtd = device_get_binding(DT_INST_LABEL(0));
+ vtd = DEVICE_DT_GET_OR_NULL(DT_DRV_INST(0));
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT DRV_COMPAT_BAK
#undef DRV_COMPAT_BAK