Skip to content

Conversation

ndrs-pst
Copy link
Contributor

@ndrs-pst ndrs-pst commented Oct 4, 2025

Simplify code by using gpio_dt_spec pointer-based API functions (gpio_pin_set_dt() and gpio_is_ready_dt()) instead of accessing individual structure members directly.

Just simplifies the code by using the `gpio_dt_spec` directly instead.

Signed-off-by: Pisit Sawangvonganan <[email protected]>
@msalau
Copy link
Contributor

msalau commented Oct 6, 2025

Hello @ndrs-pst

There is one more syscall that can be simplified: device_is_ready(cfg->de->port)
It can be replaced with gpio_is_ready_dt(cfg->de)

Simplify code by using gpio_dt_spec pointer-based API

Signed-off-by: Pisit Sawangvonganan <[email protected]>
@ndrs-pst
Copy link
Contributor Author

ndrs-pst commented Oct 6, 2025

OK, got it.

@ndrs-pst ndrs-pst changed the title modbus: serial: use gpio_pin_set_dt() for de/re pin control modbus: serial: use gpio_dt_spec pointer-based API Oct 6, 2025
Copy link

sonarqubecloud bot commented Oct 6, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants