Skip to content

Commit

Permalink
drivers/serial: stm32: Fix for stm32 serial driver not returning -ENO…
Browse files Browse the repository at this point in the history
…TSUP.

Fixes driver incorrectly indicating that drive
r supports 7 and 9 bit modes.

Fixes zephyrproject-rtos#31799

Signed-off-by: Zisis Adamos <[email protected]>
  • Loading branch information
zisisadamos committed Feb 6, 2021
1 parent d8d2749 commit 0ead6c6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/serial/uart_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,10 @@ static int uart_stm32_configure(const struct device *dev,
#endif

/* Driver doesn't support 5 or 6 databits and potentially 7 or 9 */
if ((UART_CFG_DATA_BITS_5 == cfg->data_bits) ||
(UART_CFG_DATA_BITS_6 == cfg->data_bits)
#ifndef LL_USART_DATAWIDTH_7B
|| (UART_CFG_DATA_BITS_7 == cfg->data_bits)
#endif /* LL_USART_DATAWIDTH_7B */
#ifndef LL_USART_DATAWIDTH_9B
|| (UART_CFG_DATA_BITS_9 == cfg->data_bits)
#endif /* LL_USART_DATAWIDTH_9B */
) {
if ((cfg->data_bits == UART_CFG_DATA_BITS_5) ||
(cfg->data_bits == UART_CFG_DATA_BITS_6) ||
(cfg->data_bits == UART_CFG_DATA_BITS_7) ||
(cfg->data_bits == UART_CFG_DATA_BITS_9)) {
return -ENOTSUP;
}

Expand Down

0 comments on commit 0ead6c6

Please sign in to comment.