Skip to content

Commit

Permalink
[nrf fromtree] dp: swdp_bitbang: fix missing reset pin error
Browse files Browse the repository at this point in the history
This patch fixes an issue where the reset pin is used even when it's
not given.

Signed-off-by: Maximilian Deubel <maximilian.deubel@nordicsemi.no>
(cherry picked from commit 4f85ce6eda93199946277d09bd5220b5eddd997e)
  • Loading branch information
maxd-nordic committed Nov 8, 2024
1 parent 3adbc32 commit 2e4fcd0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/dp/swdp_bitbang.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,11 @@ static int sw_port_on(const struct device *dev)
return ret;
}

ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_ACTIVE);
if (ret) {
return ret;
if (config->reset.port) {
ret = gpio_pin_configure_dt(&config->reset, GPIO_OUTPUT_ACTIVE);
if (ret) {
return ret;
}
}

return 0;
Expand Down

0 comments on commit 2e4fcd0

Please sign in to comment.