linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: Remove unused uart_get_console
@ 2025-06-08 15:46 linux
  2025-06-08 16:30 ` Randy Dunlap
  2025-06-09  7:49 ` Jiri Slaby
  0 siblings, 2 replies; 3+ messages in thread
From: linux @ 2025-06-08 15:46 UTC (permalink / raw)
  To: gregkh, jirislaby, corbet
  Cc: linux-serial, linux-doc, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

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>
---
 Documentation/driver-api/serial/driver.rst |  7 +++---
 drivers/tty/serial/serial_core.c           | 27 ----------------------
 include/linux/serial_core.h                |  2 --
 3 files changed, 3 insertions(+), 33 deletions(-)

diff --git a/Documentation/driver-api/serial/driver.rst b/Documentation/driver-api/serial/driver.rst
index fa1ebfcd4472..c1db6a1a67c4 100644
--- a/Documentation/driver-api/serial/driver.rst
+++ b/Documentation/driver-api/serial/driver.rst
@@ -24,9 +24,8 @@ console support.
 Console Support
 ---------------
 
-The serial core provides a few helper functions.  This includes identifying
-the correct port structure (via uart_get_console()) and decoding command line
-arguments (uart_parse_options()).
+The serial core provides a few helper functions.  This includes
+decoding command line arguments (uart_parse_options()).
 
 There is also a helper function (uart_console_write()) which performs a
 character by character write, translating newlines to CRLF sequences.
@@ -76,7 +75,7 @@ Other functions
            uart_add_one_port uart_remove_one_port uart_console_write
            uart_parse_earlycon uart_parse_options uart_set_options
            uart_get_lsr_info uart_handle_dcd_change uart_handle_cts_change
-           uart_try_toggle_sysrq uart_get_console
+           uart_try_toggle_sysrq
 
 .. kernel-doc:: include/linux/serial_core.h
    :identifiers: uart_port_tx_limited uart_port_tx
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 1f7708a91fc6..c15e005047bb 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2131,33 +2131,6 @@ void uart_console_write(struct uart_port *port, const char *s,
 }
 EXPORT_SYMBOL_GPL(uart_console_write);
 
-/**
- * uart_get_console - get uart port for console
- * @ports: ports to search in
- * @nr: number of @ports
- * @co: console to search for
- * Returns: uart_port for the console @co
- *
- * Check whether an invalid uart number has been specified (as @co->index), and
- * if so, search for the first available port that does have console support.
- */
-struct uart_port * __init
-uart_get_console(struct uart_port *ports, int nr, struct console *co)
-{
-	int idx = co->index;
-
-	if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 &&
-				     ports[idx].membase == NULL))
-		for (idx = 0; idx < nr; idx++)
-			if (ports[idx].iobase != 0 ||
-			    ports[idx].membase != NULL)
-				break;
-
-	co->index = idx;
-
-	return ports + idx;
-}
-
 /**
  * uart_parse_earlycon - Parse earlycon options
  * @p:	     ptr to 2nd field (ie., just beyond '<name>,')
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 914b5e97e056..cfd891357573 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -1101,8 +1101,6 @@ static inline bool uart_console_registered(struct uart_port *port)
 	return uart_console(port) && console_is_registered(port->cons);
 }
 
-struct uart_port *uart_get_console(struct uart_port *ports, int nr,
-				   struct console *c);
 int uart_parse_earlycon(char *p, enum uart_iotype *iotype,
 			resource_size_t *addr, char **options);
 void uart_parse_options(const char *options, int *baud, int *parity, int *bits,
-- 
2.49.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: Remove unused uart_get_console
  2025-06-08 15:46 [PATCH] serial: Remove unused uart_get_console linux
@ 2025-06-08 16:30 ` Randy Dunlap
  2025-06-09  7:49 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2025-06-08 16:30 UTC (permalink / raw)
  To: linux, gregkh, jirislaby, corbet; +Cc: linux-serial, linux-doc, linux-kernel



On 6/8/25 8:46 AM, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> 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>

Thanks.

> ---
>  Documentation/driver-api/serial/driver.rst |  7 +++---
>  drivers/tty/serial/serial_core.c           | 27 ----------------------
>  include/linux/serial_core.h                |  2 --
>  3 files changed, 3 insertions(+), 33 deletions(-)
> 
> diff --git a/Documentation/driver-api/serial/driver.rst b/Documentation/driver-api/serial/driver.rst
> index fa1ebfcd4472..c1db6a1a67c4 100644
> --- a/Documentation/driver-api/serial/driver.rst
> +++ b/Documentation/driver-api/serial/driver.rst
> @@ -24,9 +24,8 @@ console support.
>  Console Support
>  ---------------
>  
> -The serial core provides a few helper functions.  This includes identifying
> -the correct port structure (via uart_get_console()) and decoding command line
> -arguments (uart_parse_options()).
> +The serial core provides a few helper functions.  This includes
> +decoding command line arguments (uart_parse_options()).
>  
>  There is also a helper function (uart_console_write()) which performs a
>  character by character write, translating newlines to CRLF sequences.
> @@ -76,7 +75,7 @@ Other functions
>             uart_add_one_port uart_remove_one_port uart_console_write
>             uart_parse_earlycon uart_parse_options uart_set_options
>             uart_get_lsr_info uart_handle_dcd_change uart_handle_cts_change
> -           uart_try_toggle_sysrq uart_get_console
> +           uart_try_toggle_sysrq
>  
>  .. kernel-doc:: include/linux/serial_core.h
>     :identifiers: uart_port_tx_limited uart_port_tx
> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
> index 1f7708a91fc6..c15e005047bb 100644
> --- a/drivers/tty/serial/serial_core.c
> +++ b/drivers/tty/serial/serial_core.c
> @@ -2131,33 +2131,6 @@ void uart_console_write(struct uart_port *port, const char *s,
>  }
>  EXPORT_SYMBOL_GPL(uart_console_write);
>  
> -/**
> - * uart_get_console - get uart port for console
> - * @ports: ports to search in
> - * @nr: number of @ports
> - * @co: console to search for
> - * Returns: uart_port for the console @co
> - *
> - * Check whether an invalid uart number has been specified (as @co->index), and
> - * if so, search for the first available port that does have console support.
> - */
> -struct uart_port * __init
> -uart_get_console(struct uart_port *ports, int nr, struct console *co)
> -{
> -	int idx = co->index;
> -
> -	if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 &&
> -				     ports[idx].membase == NULL))
> -		for (idx = 0; idx < nr; idx++)
> -			if (ports[idx].iobase != 0 ||
> -			    ports[idx].membase != NULL)
> -				break;
> -
> -	co->index = idx;
> -
> -	return ports + idx;
> -}
> -
>  /**
>   * uart_parse_earlycon - Parse earlycon options
>   * @p:	     ptr to 2nd field (ie., just beyond '<name>,')
> diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
> index 914b5e97e056..cfd891357573 100644
> --- a/include/linux/serial_core.h
> +++ b/include/linux/serial_core.h
> @@ -1101,8 +1101,6 @@ static inline bool uart_console_registered(struct uart_port *port)
>  	return uart_console(port) && console_is_registered(port->cons);
>  }
>  
> -struct uart_port *uart_get_console(struct uart_port *ports, int nr,
> -				   struct console *c);
>  int uart_parse_earlycon(char *p, enum uart_iotype *iotype,
>  			resource_size_t *addr, char **options);
>  void uart_parse_options(const char *options, int *baud, int *parity, int *bits,

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] serial: Remove unused uart_get_console
  2025-06-08 15:46 [PATCH] serial: Remove unused uart_get_console linux
  2025-06-08 16:30 ` Randy Dunlap
@ 2025-06-09  7:49 ` Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Jiri Slaby @ 2025-06-09  7:49 UTC (permalink / raw)
  To: linux, gregkh, corbet; +Cc: linux-serial, linux-doc, linux-kernel

On 08. 06. 25, 17:46, linux@treblig.org wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> 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>

Reviewed-by: Jiri Slaby <jirislaby@kernel.org>


-- 
js
suse labs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-09  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-08 15:46 [PATCH] serial: Remove unused uart_get_console linux
2025-06-08 16:30 ` Randy Dunlap
2025-06-09  7:49 ` Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).