Re: [PATCH 1/2] serial: New serial driver SCCNXP
From: Alan Cox <hidden>
Date: 2012-08-29 20:11:03
On Wed, 29 Aug 2012 22:26:42 +0400 Alexander Shiyan [off-list ref] wrote:
On Wed, 29 Aug 2012 14:46:07 +0100 Alan Cox [off-list ref] wrote: Thanks for review.quoted
quoted
+ baud = uart_get_baud_rate(port, termios, old, 50, + (s->flags & SCCNXP_HAVE_MR0) ? + 230400 : 38400); + sccnxp_set_baud(port, baud);You should also write the *actal* baud rate you end up with back into termios unless B0 is requested (see 8250.c for an example). The tty core code will deal with minor variations and the detail for you (eg a user asking for B9600 and getting 9605 will be told they got their baud rate as asked)And AFAIK uart_get_baud_rate cannot return 0 for us, so check for zero baud is not needed before call tty_termios_encode_baud_rate. Right?
B0 is a bit weird. A request for 0 baud means "hang up" not "change the speed". So the check is needed really.