modbus: remove the use of DT_INST_LABEL and DT_PROP(inst, label)

Although it is possible to simply use the interface number,
it has proven convenient to use the names for the interfaces
in the samples.

Migrate to DEVICE_DT_NAME().

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
Johann Fischer 2022-07-15 18:44:11 +02:00 committed by Marti Bolivar
commit 46a0e5347d
6 changed files with 44 additions and 30 deletions

View file

@ -47,7 +47,7 @@ static struct modbus_serial_config modbus_serial_cfg[] = {
#endif
#define MODBUS_DT_GET_DEV(inst) { \
.iface_name = DT_INST_LABEL(inst), \
.iface_name = DEVICE_DT_NAME(DT_DRV_INST(inst)),\
.cfg = &modbus_serial_cfg[inst], \
},