From 1b364c1422010dd450146510237d11779395b85c Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 22 Nov 2023 12:21:30 +0000 Subject: [PATCH] drivers: console: uart_mcumgr: Skip reading FIFO during setup Drops calling the UART FIFO read function during the setup function (when not in async mode) which could cause issues on some devices since this function is not called in an ISR. Signed-off-by: Jamie McCrae --- drivers/console/uart_mcumgr.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/console/uart_mcumgr.c b/drivers/console/uart_mcumgr.c index 30b0c7be7180a9..2b068e6810c4b0 100644 --- a/drivers/console/uart_mcumgr.c +++ b/drivers/console/uart_mcumgr.c @@ -228,16 +228,9 @@ static void uart_mcumgr_setup(const struct device *uart) #else static void uart_mcumgr_setup(const struct device *uart) { - uint8_t c; - uart_irq_rx_disable(uart); uart_irq_tx_disable(uart); - /* Drain the fifo */ - while (uart_fifo_read(uart, &c, 1)) { - continue; - } - uart_irq_callback_set(uart, uart_mcumgr_isr); uart_irq_rx_enable(uart);