Re: [PATCH v2 3/8] serial: txx9: Drop usage of uart_match_port()

anemo <[email protected]> Wed, 05 Aug 2026 08:17:53 +0900 (JST)
Newsgroups org.kernel.vger.linux-serial,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Tue,  4 Aug 2026 10:57:55 +0200, Uwe Kleine-K=F6nig (The Capable Hub=
) <[email protected]> wrote:
> In the txx9 driver .iotype is always UPIO_PORT. So uart_match_port() =
is
> equivalent to comparing .iobase. Remove the call to uart_match_port()=

> which then only has a single caller that is handled in the next commi=
t.

As I noted (and tested by Geert, thanks!) in reply for previous patch,
.iotype can be UPIO_MEM.

But now (with v2 1/8 patch applied) serial_txx9_register_port() is call=
ed
only from pciserial_txx9_init_one(), so .iotype is always UPIO_PORT in
this function.

Also, in pciserial_txx9_remove_one() path .iobase is cleared, so this
(uart->iobase =3D=3D port->iobase) condition never asserts (i.e. findin=
g
matching portis unneeded now).
But dropping this can be done in furthor cleanup.

So I'm OK with your patch as is for now.

On Tue,  4 Aug 2026 10:57:55 +0200, Uwe Kleine-K=F6nig (The Capable Hub=
) <[email protected]> wrote:
> In the txx9 driver .iotype is always UPIO_PORT. So uart_match_port() =
is
> equivalent to comparing .iobase. Remove the call to uart_match_port()=

> which then only has a single caller that is handled in the next commi=
t.
> =

> Signed-off-by: Uwe Kleine-K=F6nig (The Capable Hub) <u.kleine-koenig@=
baylibre.com>
> ---
>  drivers/tty/serial/serial_txx9.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> =

> diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/se=
rial_txx9.c
> index bda7f7527b8d..8febc0549f76 100644
> --- a/drivers/tty/serial/serial_txx9.c
> +++ b/drivers/tty/serial/serial_txx9.c
> @@ -911,7 +911,7 @@ static int serial_txx9_register_port(struct uart_=
port *port)
>  	mutex_lock(&serial_txx9_mutex);
>  	for (i =3D 0; i < UART_NR; i++) {
>  		uart =3D &serial_txx9_ports[i];
> -		if (uart_match_port(uart, port)) {
> +		if (uart->iobase =3D=3D port->iobase) {
>  			uart_remove_one_port(&serial_txx9_reg, uart);
>  			break;
>  		}
> -- =

> 2.55.0.11.g153666a7d9bb