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 <[email protected]>
(cherry picked from commit 4f85ce6)
  • Loading branch information
maxd-nordic authored and rlubos committed Nov 12, 2024
1 parent a70d6bd commit 0271821
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 0271821

Please sign in to comment.