From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] serial: ns16550: fall back to using uart8250/ttyS as Linux console names
Date: Wed, 20 May 2026 08:09:05 +0200 [thread overview]
Message-ID: <20260520060906.1869692-1-a.fatoum@pengutronix.de> (raw)
Most Linux drivers use the same names, so make them the default and only
list differing ones in the different ns16550_drvdata.
This also ensures, we don't end up with <NULL> formatted into the kernel
command-line by mistake.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/serial/serial_ns16550.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 31e7c006d004..72bf8e464759 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -390,21 +390,15 @@ static void ns16550_probe_dt(struct device *dev, struct ns16550_priv *priv)
static struct ns16550_drvdata ns16450_drvdata = {
.init_port = ns16450_serial_init_port,
- .linux_console_name = "ttyS",
- .linux_earlycon_name = "uart8250",
};
static struct ns16550_drvdata ns16550_drvdata = {
.init_port = ns16550_serial_init_port,
- .linux_console_name = "ttyS",
- .linux_earlycon_name = "uart8250",
};
static __maybe_unused struct ns16550_drvdata omap_drvdata = {
.init_port = ns16550_omap_init_port,
-#ifdef CONFIG_DRIVER_SERIAL_NS16550_OMAP_TTYS
- .linux_console_name = "ttyS",
-#else
+#ifndef CONFIG_DRIVER_SERIAL_NS16550_OMAP_TTYS
.linux_console_name = "ttyO",
#endif
.linux_earlycon_name = "omap8250",
@@ -412,20 +406,16 @@ static __maybe_unused struct ns16550_drvdata omap_drvdata = {
static __maybe_unused struct ns16550_drvdata omap_clk48m_drvdata = {
.init_port = ns16550_omap_init_port,
- .linux_console_name = "ttyS",
- .linux_earlycon_name = "uart8250",
.clk_default = 48000000,
};
static __maybe_unused struct ns16550_drvdata jz_drvdata = {
.init_port = ns16550_jz_init_port,
- .linux_console_name = "ttyS",
.linux_earlycon_name = "jz4740_uart",
};
static __maybe_unused struct ns16550_drvdata rpi_drvdata = {
.init_port = rpi_init_port,
- .linux_console_name = "ttyS",
.linux_earlycon_name = "bcm2835aux",
};
@@ -510,6 +500,7 @@ static int ns16550_probe(struct device *dev)
struct NS16550_plat *plat = (struct NS16550_plat *)dev->platform_data;
const struct ns16550_drvdata *devtype;
struct resource *iores;
+ const char *linux_earlycon_name;
int ret;
devtype = device_get_match_data(dev) ?: &ns16550_drvdata;
@@ -550,8 +541,10 @@ static int ns16550_probe(struct device *dev)
cdev->getc = ns16550_getc;
cdev->setbrg = priv->plat.clock ? ns16550_setbaudrate : NULL;
cdev->flush = ns16550_flush;
- cdev->linux_console_name = devtype->linux_console_name;
- cdev->linux_earlycon_name = basprintf("%s,%s", devtype->linux_earlycon_name,
+ cdev->linux_console_name = devtype->linux_console_name ?: "ttyS";
+ linux_earlycon_name = devtype->linux_earlycon_name ?: "uart8250";
+
+ cdev->linux_earlycon_name = basprintf("%s,%s", linux_earlycon_name,
priv->access_type);
cdev->phys_base = !strcmp(priv->access_type, "io") ?
IOMEM((ulong)priv->iobase) : priv->mmiobase;
--
2.47.3
next reply other threads:[~2026-05-20 6:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-20 6:09 Ahmad Fatoum [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-05-19 5:53 Ahmad Fatoum
2026-05-21 11:41 ` Sascha Hauer
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=20260520060906.1869692-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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