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 <andrzej.glabek@nordicsemi.no>
This commit is contained in:
Andrzej Głąbek 2022-11-17 18:00:37 +01:00 committed by Stephanos Ioannidis
commit 595fbf9b97

View file

@ -662,9 +662,7 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev)
nrfx_timer_enable(&cfg->timer);
nrfx_timer_clear(&cfg->timer);
}
}
if (HW_RX_COUNTING_ENABLED(data)) {
ret = gppi_channel_alloc(&data->async->rx_cnt.ppi);
if (ret != NRFX_SUCCESS) {
LOG_ERR("Failed to allocate PPI Channel, "
@ -672,9 +670,7 @@ static int uarte_nrfx_rx_counting_init(const struct device *dev)
data->async->hw_rx_counting = false;
nrfx_timer_uninit(&cfg->timer);
}
}
if (HW_RX_COUNTING_ENABLED(data)) {
#if CONFIG_HAS_HW_NRF_PPI
ret = nrfx_ppi_channel_assign(
data->async->rx_cnt.ppi,