[PATCH tty/serial 1/1] serial: fsl_lpuart: clear parity enable bit when disable parity

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Fugang Duan <fugang.duan@xxxxxxx>

Current driver only enable parity enable bit and never clear it
when user set the termios. The fix clear the parity enable bit when
PARENB flag is not set in termios->c_cflag.

The patch also correct the typo "UARTCR1_PE" to "UARTCTRL_PE" although
there has no function impacted.

Signed-off-by: Fugang Duan <fugang.duan@xxxxxxx>
---
 drivers/tty/serial/fsl_lpuart.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 51e47a6..4219119 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1476,6 +1476,8 @@ static void lpuart32_shutdown(struct uart_port *port)
 			else
 				cr1 &= ~UARTCR1_PT;
 		}
+	} else {
+		cr1 &= ~UARTCR1_PE;
 	}
 
 	/* ask the core to calculate the divisor */
@@ -1679,7 +1681,7 @@ static void lpuart32_shutdown(struct uart_port *port)
 			ctrl &= ~UARTCTRL_PE;
 			ctrl |= UARTCTRL_M;
 		} else {
-			ctrl |= UARTCR1_PE;
+			ctrl |= UARTCTRL_PE;
 			if ((termios->c_cflag & CSIZE) == CS8)
 				ctrl |= UARTCTRL_M;
 			if (termios->c_cflag & PARODD)
@@ -1687,6 +1689,8 @@ static void lpuart32_shutdown(struct uart_port *port)
 			else
 				ctrl &= ~UARTCTRL_PT;
 		}
+	} else {
+		ctrl &= ~UARTCTRL_PE;
 	}
 
 	/* ask the core to calculate the divisor */
-- 
1.9.1





[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux