From: Tony Lindgren <tony.lindgren@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>, Petr Mladek <pmladek@suse.com>,
Steven Rostedt <rostedt@goodmis.org>,
John Ogness <john.ogness@linutronix.de>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Tony Lindgren <tony@atomide.com>
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-serial@vger.kernel.org,
"Tony Lindgren" <tony.lindgren@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 3/3] serial: core: Rename preferred console handling for match and update
Date: Tue, 18 Jun 2024 07:54:50 +0300 [thread overview]
Message-ID: <20240618045458.14731-4-tony.lindgren@linux.intel.com> (raw)
In-Reply-To: <20240618045458.14731-1-tony.lindgren@linux.intel.com>
We are now matching and updating the preferred console, not adding it.
Let's update the naming accordingly to avoid confusion.
Suggested-by: Petr Mladek <pmladek@suse.com>
Signed-off-by: Tony Lindgren <tony.lindgren@linux.intel.com>
---
drivers/tty/serial/8250/8250_core.c | 4 ++--
drivers/tty/serial/serial_base.h | 4 ++--
drivers/tty/serial/serial_base_bus.c | 21 +++++++++++----------
3 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index ff15022369e4..3556fe42ec65 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -42,7 +42,7 @@
#include <asm/irq.h>
-#include "../serial_base.h" /* For serial_base_add_isa_preferred_console() */
+#include "../serial_base.h" /* For serial_base_match_and_update_isa_preferred_console() */
#include "8250.h"
@@ -564,7 +564,7 @@ static void __init serial8250_isa_init_ports(void)
if (serial8250_isa_config != NULL)
serial8250_isa_config(i, &up->port, &up->capabilities);
- serial_base_add_isa_preferred_console(serial8250_reg.dev_name, i);
+ serial_base_match_and_update_isa_preferred_console(serial8250_reg.dev_name, i);
}
}
diff --git a/drivers/tty/serial/serial_base.h b/drivers/tty/serial/serial_base.h
index 743a72ac34f3..a5632eeda250 100644
--- a/drivers/tty/serial/serial_base.h
+++ b/drivers/tty/serial/serial_base.h
@@ -68,12 +68,12 @@ int serial_base_add_preferred_console(struct uart_driver *drv,
#ifdef CONFIG_SERIAL_8250_CONSOLE
-int serial_base_add_isa_preferred_console(const char *name, int idx);
+int serial_base_match_and_update_isa_preferred_console(const char *name, int idx);
#else
static inline
-int serial_base_add_isa_preferred_console(const char *name, int idx)
+int serial_base_match_and_update_isa_preferred_console(const char *name, int idx)
{
return 0;
}
diff --git a/drivers/tty/serial/serial_base_bus.c b/drivers/tty/serial/serial_base_bus.c
index 2cf86f1ff298..391d41ef5942 100644
--- a/drivers/tty/serial/serial_base_bus.c
+++ b/drivers/tty/serial/serial_base_bus.c
@@ -207,8 +207,9 @@ void serial_base_port_device_remove(struct serial_port_device *port_dev)
#ifdef CONFIG_SERIAL_CORE_CONSOLE
-static int serial_base_add_one_prefcon(const char *match, const char *dev_name,
- int port_id)
+static int serial_base_match_and_update_one_prefcon(const char *match,
+ const char *dev_name,
+ int port_id)
{
int ret;
@@ -237,7 +238,7 @@ static int serial_base_add_sparc_console(const char *dev_name, int idx)
return 0;
}
- return serial_base_add_one_prefcon(name, dev_name, idx);
+ return serial_base_match_and_update_one_prefcon(name, dev_name, idx);
}
#else
@@ -249,7 +250,7 @@ static inline int serial_base_add_sparc_console(const char *dev_name, int idx)
#endif
-static int serial_base_add_prefcon(const char *name, int idx)
+static int serial_base_match_and_update_prefcon(const char *name, int idx)
{
const char *char_match __free(kfree) = NULL;
const char *nmbr_match __free(kfree) = NULL;
@@ -262,7 +263,7 @@ static int serial_base_add_prefcon(const char *name, int idx)
if (!nmbr_match)
return -ENODEV;
- ret = serial_base_add_one_prefcon(nmbr_match, name, idx);
+ ret = serial_base_match_and_update_one_prefcon(nmbr_match, name, idx);
if (ret)
return ret;
@@ -277,7 +278,7 @@ static int serial_base_add_prefcon(const char *name, int idx)
if (!char_match)
return -ENOMEM;
- return serial_base_add_one_prefcon(char_match, name, idx);
+ return serial_base_match_and_update_one_prefcon(char_match, name, idx);
}
/**
@@ -304,7 +305,7 @@ int serial_base_add_preferred_console(struct uart_driver *drv,
const char *port_match __free(kfree) = NULL;
int ret;
- ret = serial_base_add_prefcon(drv->dev_name, port->line);
+ ret = serial_base_match_and_update_prefcon(drv->dev_name, port->line);
if (ret)
return ret;
@@ -314,7 +315,7 @@ int serial_base_add_preferred_console(struct uart_driver *drv,
return -ENOMEM;
/* Translate a hardware addressing style console=DEVNAME:0.0 */
- return serial_base_add_one_prefcon(port_match, drv->dev_name, port->line);
+ return serial_base_match_and_update_one_prefcon(port_match, drv->dev_name, port->line);
}
#endif
@@ -326,9 +327,9 @@ int serial_base_add_preferred_console(struct uart_driver *drv,
* This should be only called from serial8250_isa_init_preferred_console(),
* other callers are likely wrong and should rely on earlycon instead.
*/
-int serial_base_add_isa_preferred_console(const char *name, int idx)
+int serial_base_match_and_update_isa_preferred_console(const char *name, int idx)
{
- return serial_base_add_prefcon(name, idx);
+ return serial_base_match_and_update_prefcon(name, idx);
}
#endif
--
2.45.2
next prev parent reply other threads:[~2024-06-18 4:55 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 4:54 [PATCH v3 0/3] Fixes for console command line ordering Tony Lindgren
2024-06-18 4:54 ` [PATCH v3 1/3] printk: Revert add_preferred_console_match() related commits Tony Lindgren
2024-06-18 4:54 ` [PATCH v3 2/3] printk: Add match_devname_and_update_preferred_console() Tony Lindgren
2024-06-18 13:16 ` Petr Mladek
2024-06-18 4:54 ` Tony Lindgren [this message]
2024-06-18 5:38 ` [PATCH v3 3/3] serial: core: Rename preferred console handling for match and update Greg Kroah-Hartman
2024-06-18 13:51 ` Petr Mladek
2024-06-19 4:39 ` Tony Lindgren
2024-06-19 7:17 ` Tony Lindgren
2024-06-19 12:08 ` Petr Mladek
2024-06-19 12:35 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240618045458.14731-4-tony.lindgren@linux.intel.com \
--to=tony.lindgren@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=jirislaby@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=senozhatsky@chromium.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox