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:
parent
e63643d212
commit
e1e8179690
3 changed files with 3 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue