]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: pass struct uart_state to uart_line_info()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 17 Mar 2025 07:00:41 +0000 (08:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Mar 2025 15:00:52 +0000 (08:00 -0700)
uart_line_info() wants to work with struct uart_state. Do not pass a
driver and an index. Pass the precomputed struct directly.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250317070046.24386-27-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index c26a7cfa3778b94f1d5ee162156f59b200e1c589..20b2d5c5df6de3c540b76e741f4161f9f85f60c2 100644 (file)
@@ -2013,9 +2013,8 @@ static const char *uart_type(struct uart_port *port)
 
 #ifdef CONFIG_PROC_FS
 
-static void uart_line_info(struct seq_file *m, struct uart_driver *drv, int i)
+static void uart_line_info(struct seq_file *m, struct uart_state *state)
 {
-       struct uart_state *state = drv->state + i;
        struct tty_port *port = &state->port;
        enum uart_pm_state pm_state;
        struct uart_port *uport;
@@ -2100,7 +2099,7 @@ static int uart_proc_show(struct seq_file *m, void *v)
 
        seq_printf(m, "serinfo:1.0 driver%s%s revision:%s\n", "", "", "");
        for (i = 0; i < drv->nr; i++)
-               uart_line_info(m, drv, i);
+               uart_line_info(m, drv->state + i);
        return 0;
 }
 #endif