Skip to content

Commit 595fbf9

Browse files
ananglstephanosio
authored andcommitted
drivers: uart_nrfx_uarte: Remove redundant HW_RX_COUNTING_ENABLED calls
Merge three adjacent `if (HW_RX_COUNTING_ENABLED(data))` blocks into a common one. Signed-off-by: Andrzej Głąbek <[email protected]>
1 parent 9628ecd commit 595fbf9

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

drivers/serial/uart_nrfx_uarte.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,19 +662,15 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev)
662662
nrfx_timer_enable(&cfg->timer);
663663
nrfx_timer_clear(&cfg->timer);
664664
}
665-
}
666665

667-
if (HW_RX_COUNTING_ENABLED(data)) {
668666
ret = gppi_channel_alloc(&data->async->rx_cnt.ppi);
669667
if (ret != NRFX_SUCCESS) {
670668
LOG_ERR("Failed to allocate PPI Channel, "
671669
"switching to software byte counting.");
672670
data->async->hw_rx_counting = false;
673671
nrfx_timer_uninit(&cfg->timer);
674672
}
675-
}
676673

677-
if (HW_RX_COUNTING_ENABLED(data)) {
678674
#if CONFIG_HAS_HW_NRF_PPI
679675
ret = nrfx_ppi_channel_assign(
680676
data->async->rx_cnt.ppi,

0 commit comments

Comments
 (0)