Skip to content

Commit e21d1d2

Browse files
committed
modbus: serial: use gpio_is_ready_dt() for GPIO readiness check
Simplify code by using gpio_dt_spec pointer-based API Signed-off-by: Pisit Sawangvonganan <[email protected]>
1 parent 4dc71b5 commit e21d1d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

subsys/modbus/modbus_serial.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static int configure_gpio(struct modbus_context *ctx)
509509
struct modbus_serial_config *cfg = ctx->cfg;
510510

511511
if (cfg->de != NULL) {
512-
if (!device_is_ready(cfg->de->port)) {
512+
if (!gpio_is_ready_dt(cfg->de)) {
513513
return -ENODEV;
514514
}
515515

@@ -520,7 +520,7 @@ static int configure_gpio(struct modbus_context *ctx)
520520

521521

522522
if (cfg->re != NULL) {
523-
if (!device_is_ready(cfg->re->port)) {
523+
if (!gpio_is_ready_dt(cfg->re)) {
524524
return -ENODEV;
525525
}
526526

0 commit comments

Comments
 (0)