Re: [PATCH v3 2/3] serial: sh-sci: Drop check for zero baud rate from uart_get_baud_rate()
From: Hugo Villeneuve
Date: Mon Apr 20 2026 - 13:29:58 EST
Hi Biju,
On Mon, 20 Apr 2026 15:04:22 +0100
Biju <biju.das.au@xxxxxxxxx> wrote:
> From: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
>
> On DT systems, a zero baud rate from uart_get_baud_rate() is not possible
> even earlycon derives its bit rate from chosen/stdout-path. The zero baud
> guard and its associated done label are therefore dead code. So remove it.
>
> Also drop the unused done label from rsci_set_termios().
>
> Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx>
Acked-by: Hugo Villeneuve <hvilleneuve@xxxxxxxxxxxx>
> ---
> v3:
> * New patch
> ---
> drivers/tty/serial/rsci.c | 3 ---
> drivers/tty/serial/sh-sci.c | 2 --
> 2 files changed, 5 deletions(-)
>
> diff --git a/drivers/tty/serial/rsci.c b/drivers/tty/serial/rsci.c
> index b00c9e385169..40db9daa4272 100644
> --- a/drivers/tty/serial/rsci.c
> +++ b/drivers/tty/serial/rsci.c
> @@ -265,8 +265,6 @@ static void rsci_set_termios(struct uart_port *port, struct ktermios *termios,
> }
>
> baud = uart_get_baud_rate(port, termios, old, 0, max_freq);
> - if (!baud)
> - goto done;
>
> /* Divided Functional Clock using standard Bit Rate Register */
> err = sci_scbrr_calc(s, baud, &brr1, &srr1, &cks1);
> @@ -278,7 +276,6 @@ static void rsci_set_termios(struct uart_port *port, struct ktermios *termios,
> cks = cks1;
> }
> -done:
> if (best_clk >= 0)
> dev_dbg(port->dev, "Using clk %pC for %u%+d bps\n",
> s->clks[best_clk], baud, min_err);
> diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
> index 7473b26ce9cf..9be359e04995 100644
> --- a/drivers/tty/serial/sh-sci.c
> +++ b/drivers/tty/serial/sh-sci.c
> @@ -2719,8 +2719,6 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
> max_freq = max(max_freq, s->clk_rates[i]);
>
> baud = uart_get_baud_rate(port, termios, old, 0, max_freq / min_sr(s));
> - if (!baud)
> - goto done;
>
> /*
> * There can be multiple sources for the sampling clock. Find the one
> --
> 2.43.0
>
>
--
Hugo Villeneuve