Re: [PATCH 2/4] serial: 8250: export serial8250_get_baud_rate()

Ilpo Järvinen <[email protected]>
Newsgroups org.kernel.vger.linux-serial,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, 9 Jul 2026, Christian Marangi wrote:

> Some driver might need to access the current baud rate to correctly
> configure it.
> 
> Export the serial8250_get_baud_rate() function to limit code duplication.
> 
> Signed-off-by: Christian Marangi <[email protected]>
> ---
>  drivers/tty/serial/8250/8250_port.c | 7 ++++---
>  include/linux/serial_8250.h         | 4 ++++
>  2 files changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index 630deb7dd344..033d8fb8bb23 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -2560,9 +2560,9 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud,
>  		serial8250_do_set_divisor(port, baud, quot);
>  }
>  
> -static unsigned int serial8250_get_baud_rate(struct uart_port *port,
> -					     struct ktermios *termios,
> -					     const struct ktermios *old)
> +unsigned int serial8250_get_baud_rate(struct uart_port *port,
> +				      struct ktermios *termios,
> +				      const struct ktermios *old)
>  {
>  	unsigned int tolerance = port->uartclk / 100;
>  	unsigned int min;
> @@ -2589,6 +2589,7 @@ static unsigned int serial8250_get_baud_rate(struct uart_port *port,
>  	 */
>  	return uart_get_baud_rate(port, termios, old, min, max);
>  }
> +EXPORT_SYMBOL_GPL(serial8250_get_baud_rate);

Please put newly exported things into SERIAL_8250 namespace.

-- 
 i.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.