modbus: serial: Convert to DEVICE_DT_GET

Move to using DEVICE_DT_GET so we can phase out DT_LABEL.

Signed-off-by: Kumar Gala <galak@kernel.org>
This commit is contained in:
Kumar Gala 2022-06-27 11:35:27 -05:00 committed by Carles Cufí
commit e1e8179690
3 changed files with 3 additions and 7 deletions

View file

@ -516,10 +516,8 @@ int modbus_serial_init(struct modbus_context *ctx,
return -ENOTSUP;
}
cfg->dev = device_get_binding(cfg->dev_name);
if (cfg->dev == NULL) {
LOG_ERR("Failed to get UART device %s",
cfg->dev_name);
if (!device_is_ready(cfg->dev)) {
LOG_ERR("Bus device %s is not ready", cfg->dev->name);
return -ENODEV;
}