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>
This commit is contained in:
Gerard Marull-Paretas 2022-01-28 15:40:22 +01:00 committed by Anas Nashif
commit 0ddb8b5d62

View file

@ -135,7 +135,7 @@ static bool get_vtd(void)
#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