[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221221105402.6598-2-markuss.broks@gmail.com>
Date: Wed, 21 Dec 2022 12:53:58 +0200
From: Markuss Broks <markuss.broks@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Jami Kettunen <jami.kettunen@...tonmail.com>,
Markuss Broks <markuss.broks@...il.com>,
Jonathan Corbet <corbet@....net>,
Ard Biesheuvel <ardb@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Helge Deller <deller@....de>, Borislav Petkov <bp@...e.de>,
"Paul E. McKenney" <paulmck@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Will Deacon <will@...nel.org>,
Randy Dunlap <rdunlap@...radead.org>,
Muchun Song <muchun.song@...ux.dev>,
Damien Le Moal <damien.lemoal@...nsource.wdc.com>,
Kim Phillips <kim.phillips@....com>, linux-doc@...r.kernel.org,
linux-efi@...r.kernel.org, linux-serial@...r.kernel.org,
linux-fbdev@...r.kernel.org, dri-devel@...ts.freedesktop.org
Subject: [PATCH v3 1/3] drivers: serial: earlycon: Pass device-tree node
Pass a pointer to device-tree node in case the driver probed from
OF. This makes early console drivers able to fetch options from
device-tree node properties.
Signed-off-by: Markuss Broks <markuss.broks@...il.com>
---
drivers/tty/serial/earlycon.c | 3 +++
include/linux/serial_core.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 4f6e9bf57169..0c7a789d7eb7 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -307,6 +307,9 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
strscpy(early_console_dev.options, options,
sizeof(early_console_dev.options));
}
+
+ early_console_dev.node = node;
+
earlycon_init(&early_console_dev, match->name);
err = match->setup(&early_console_dev, options);
earlycon_print_info(&early_console_dev);
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index fd59f600094a..0b06c0ee7705 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -783,6 +783,7 @@ struct earlycon_device {
struct uart_port port;
char options[16]; /* e.g., 115200n8 */
unsigned int baud;
+ unsigned long node;
};
struct earlycon_id {
--
2.39.0
Powered by blists - more mailing lists