Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: Remove unused uart_get_console

uart_get_console() has been unused since 2019's
commit bd0d9d159988 ("serial: remove ks8695 driver")

Remove it, and it's associated docs.

Signed-off-by: "Dr. David Alan Gilbert" <linux@treblig.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20250608154654.73994-1-linux@treblig.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dr. David Alan Gilbert and committed by
Greg Kroah-Hartman
d574c5dc 4fcc287f

+3 -33
+3 -4
Documentation/driver-api/serial/driver.rst
··· 24 24 Console Support 25 25 --------------- 26 26 27 - The serial core provides a few helper functions. This includes identifying 28 - the correct port structure (via uart_get_console()) and decoding command line 29 - arguments (uart_parse_options()). 27 + The serial core provides a few helper functions. This includes 28 + decoding command line arguments (uart_parse_options()). 30 29 31 30 There is also a helper function (uart_console_write()) which performs a 32 31 character by character write, translating newlines to CRLF sequences. ··· 75 76 uart_add_one_port uart_remove_one_port uart_console_write 76 77 uart_parse_earlycon uart_parse_options uart_set_options 77 78 uart_get_lsr_info uart_handle_dcd_change uart_handle_cts_change 78 - uart_try_toggle_sysrq uart_get_console 79 + uart_try_toggle_sysrq 79 80 80 81 .. kernel-doc:: include/linux/serial_core.h 81 82 :identifiers: uart_port_tx_limited uart_port_tx
-27
drivers/tty/serial/serial_core.c
··· 2132 2132 EXPORT_SYMBOL_GPL(uart_console_write); 2133 2133 2134 2134 /** 2135 - * uart_get_console - get uart port for console 2136 - * @ports: ports to search in 2137 - * @nr: number of @ports 2138 - * @co: console to search for 2139 - * Returns: uart_port for the console @co 2140 - * 2141 - * Check whether an invalid uart number has been specified (as @co->index), and 2142 - * if so, search for the first available port that does have console support. 2143 - */ 2144 - struct uart_port * __init 2145 - uart_get_console(struct uart_port *ports, int nr, struct console *co) 2146 - { 2147 - int idx = co->index; 2148 - 2149 - if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 && 2150 - ports[idx].membase == NULL)) 2151 - for (idx = 0; idx < nr; idx++) 2152 - if (ports[idx].iobase != 0 || 2153 - ports[idx].membase != NULL) 2154 - break; 2155 - 2156 - co->index = idx; 2157 - 2158 - return ports + idx; 2159 - } 2160 - 2161 - /** 2162 2135 * uart_parse_earlycon - Parse earlycon options 2163 2136 * @p: ptr to 2nd field (ie., just beyond '<name>,') 2164 2137 * @iotype: ptr for decoded iotype (out)
-2
include/linux/serial_core.h
··· 1101 1101 return uart_console(port) && console_is_registered(port->cons); 1102 1102 } 1103 1103 1104 - struct uart_port *uart_get_console(struct uart_port *ports, int nr, 1105 - struct console *c); 1106 1104 int uart_parse_earlycon(char *p, enum uart_iotype *iotype, 1107 1105 resource_size_t *addr, char **options); 1108 1106 void uart_parse_options(const char *options, int *baud, int *parity, int *bits,