Commit c87391b5 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman
Browse files

serial: dz: Assume previous baudrate is valid

parent 292e2e7a
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -592,9 +592,12 @@ static void dz_set_termios(struct uart_port *uport, struct ktermios *termios,

	baud = uart_get_baud_rate(uport, termios, old_termios, 50, 9600);
	bflag = dz_encode_baud_rate(baud);
	if (bflag < 0)	{			/* Try to keep unchanged.  */
		baud = uart_get_baud_rate(uport, old_termios, NULL, 50, 9600);
	if (bflag < 0)	{
		if (old_termios) {
			/* Keep unchanged. */
			baud = tty_termios_baud_rate(old_termios);
			bflag = dz_encode_baud_rate(baud);
		}
		if (bflag < 0)	{		/* Resort to 9600.  */
			baud = 9600;
			bflag = DZ_B9600;