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:
parent
b15fb9cb2f
commit
0ddb8b5d62
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ static bool get_vtd(void)
|
||||||
#define DRV_COMPAT_BAK DT_DRV_COMPAT
|
#define DRV_COMPAT_BAK DT_DRV_COMPAT
|
||||||
#undef DT_DRV_COMPAT
|
#undef DT_DRV_COMPAT
|
||||||
#define DT_DRV_COMPAT intel_vt_d
|
#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
|
#undef DT_DRV_COMPAT
|
||||||
#define DT_DRV_COMPAT DRV_COMPAT_BAK
|
#define DT_DRV_COMPAT DRV_COMPAT_BAK
|
||||||
#undef DRV_COMPAT_BAK
|
#undef DRV_COMPAT_BAK
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue