serial: core: tidy invalid baudrate handling in uart_get_baud_rate
authorMax Filippov <jcmvbkbc@gmail.com>
Tue, 10 Oct 2023 08:59:22 +0000 (01:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Oct 2023 18:15:41 +0000 (20:15 +0200)
commit23bf72faaebdf2cb199c0ef8cf96467b10904b35
treed7cf2cab4278bfe6d7906c979a5b3eaf64c00481
parent1ed59c5e17936c8f3a0fb7b4217af0b73298d2d7
serial: core: tidy invalid baudrate handling in uart_get_baud_rate

uart_get_baud_rate has input parameters 'min' and 'max' limiting the
range of acceptable baud rates from the caller's perspective. If neither
current or old termios structures have acceptable baud rate setting and
9600 is not in the min/max range either the function returns 0 and
issues a warning.
However for a UART that does not support speed of 9600 baud this is
expected behavior.
Clarify that 0 can be (and always could be) returned from the
uart_get_baud_rate. Don't issue a warning in that case.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Link: https://lore.kernel.org/r/20231010085926.1021667-2-jcmvbkbc@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c