serial: efm32: Fix parity management in 'efm32_uart_console_get_options()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 12 May 2017 14:35:45 +0000 (16:35 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 2 Nov 2017 06:16:26 +0000 (07:16 +0100)
commit12d805b590300156e3d9381b6e7f0a549248265c
tree8288fa3499660233d80c39a6ff5c63144fccd160
parentf6b525b94bda339cf0064e2561fc7e7747bb46a8
serial: efm32: Fix parity management in 'efm32_uart_console_get_options()'

commit be40597a1bc173bf9dadccdf5388b956f620ae8f upstream.

UARTn_FRAME_PARITY_ODD is 0x0300
UARTn_FRAME_PARITY_EVEN is 0x0200
So if the UART is configured for EVEN parity, it would be reported as ODD.
Fix it by correctly testing if the 2 bits are set.

Fixes: 3afbd89c9639 ("serial/efm32: add new driver")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
drivers/tty/serial/efm32-uart.c