* [PATCH] tty: serial: meson: enable console as module
@ 2020-12-11 0:57 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2020-12-11 0:57 UTC (permalink / raw)
To: linux-serial
Cc: Greg Kroah-Hartman, Jiri Slaby, Neil Armstrong, Jerome Brunet,
Martin Blumenstingl, open list,
moderated list:ARM/Amlogic Meson SoC support,
open list:ARM/Amlogic Meson SoC support
Enable serial driver to be built as a module. To do so, init the
console support on driver/module load instead of using
console_initcall().
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
Yes, I'm well aware that having the serial console as a module makes
devices hard to debug, so I'm not changing any default behavior. The
goal is just to enable building as a module for environments where
serial debug is not available or needed.
drivers/tty/serial/Kconfig | 2 +-
drivers/tty/serial/meson_uart.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1044fc387691..c3fa78e63357 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -206,7 +206,7 @@ config SERIAL_MESON
config SERIAL_MESON_CONSOLE
bool "Support for console on meson"
- depends on SERIAL_MESON=y
+ depends on SERIAL_MESON
select SERIAL_CORE_CONSOLE
select SERIAL_EARLYCON
help
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index d2c08b760f83..69eeef9edfa5 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -604,7 +604,6 @@ static int __init meson_serial_console_init(void)
register_console(&meson_serial_console);
return 0;
}
-console_initcall(meson_serial_console_init);
static void meson_serial_early_console_write(struct console *co,
const char *s,
@@ -634,6 +633,9 @@ OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
#define MESON_SERIAL_CONSOLE (&meson_serial_console)
#else
+static int __init meson_serial_console_init(void) {
+ return 0;
+}
#define MESON_SERIAL_CONSOLE NULL
#endif
@@ -824,6 +826,10 @@ static int __init meson_uart_init(void)
{
int ret;
+ ret = meson_serial_console_init();
+ if (ret)
+ return ret;
+
ret = uart_register_driver(&meson_uart_driver);
if (ret)
return ret;
--
2.29.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] tty: serial: meson: enable console as module
@ 2020-12-11 0:57 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2020-12-11 0:57 UTC (permalink / raw)
To: linux-serial
Cc: Neil Armstrong, Martin Blumenstingl, Greg Kroah-Hartman,
open list, open list:ARM/Amlogic Meson SoC support, Jiri Slaby,
moderated list:ARM/Amlogic Meson SoC support, Jerome Brunet
Enable serial driver to be built as a module. To do so, init the
console support on driver/module load instead of using
console_initcall().
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
Yes, I'm well aware that having the serial console as a module makes
devices hard to debug, so I'm not changing any default behavior. The
goal is just to enable building as a module for environments where
serial debug is not available or needed.
drivers/tty/serial/Kconfig | 2 +-
drivers/tty/serial/meson_uart.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1044fc387691..c3fa78e63357 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -206,7 +206,7 @@ config SERIAL_MESON
config SERIAL_MESON_CONSOLE
bool "Support for console on meson"
- depends on SERIAL_MESON=y
+ depends on SERIAL_MESON
select SERIAL_CORE_CONSOLE
select SERIAL_EARLYCON
help
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index d2c08b760f83..69eeef9edfa5 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -604,7 +604,6 @@ static int __init meson_serial_console_init(void)
register_console(&meson_serial_console);
return 0;
}
-console_initcall(meson_serial_console_init);
static void meson_serial_early_console_write(struct console *co,
const char *s,
@@ -634,6 +633,9 @@ OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
#define MESON_SERIAL_CONSOLE (&meson_serial_console)
#else
+static int __init meson_serial_console_init(void) {
+ return 0;
+}
#define MESON_SERIAL_CONSOLE NULL
#endif
@@ -824,6 +826,10 @@ static int __init meson_uart_init(void)
{
int ret;
+ ret = meson_serial_console_init();
+ if (ret)
+ return ret;
+
ret = uart_register_driver(&meson_uart_driver);
if (ret)
return ret;
--
2.29.2
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] tty: serial: meson: enable console as module
@ 2020-12-11 0:57 ` Kevin Hilman
0 siblings, 0 replies; 6+ messages in thread
From: Kevin Hilman @ 2020-12-11 0:57 UTC (permalink / raw)
To: linux-serial
Cc: Neil Armstrong, Martin Blumenstingl, Greg Kroah-Hartman,
open list, open list:ARM/Amlogic Meson SoC support, Jiri Slaby,
moderated list:ARM/Amlogic Meson SoC support, Jerome Brunet
Enable serial driver to be built as a module. To do so, init the
console support on driver/module load instead of using
console_initcall().
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
---
Yes, I'm well aware that having the serial console as a module makes
devices hard to debug, so I'm not changing any default behavior. The
goal is just to enable building as a module for environments where
serial debug is not available or needed.
drivers/tty/serial/Kconfig | 2 +-
drivers/tty/serial/meson_uart.c | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 1044fc387691..c3fa78e63357 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -206,7 +206,7 @@ config SERIAL_MESON
config SERIAL_MESON_CONSOLE
bool "Support for console on meson"
- depends on SERIAL_MESON=y
+ depends on SERIAL_MESON
select SERIAL_CORE_CONSOLE
select SERIAL_EARLYCON
help
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c
index d2c08b760f83..69eeef9edfa5 100644
--- a/drivers/tty/serial/meson_uart.c
+++ b/drivers/tty/serial/meson_uart.c
@@ -604,7 +604,6 @@ static int __init meson_serial_console_init(void)
register_console(&meson_serial_console);
return 0;
}
-console_initcall(meson_serial_console_init);
static void meson_serial_early_console_write(struct console *co,
const char *s,
@@ -634,6 +633,9 @@ OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart",
#define MESON_SERIAL_CONSOLE (&meson_serial_console)
#else
+static int __init meson_serial_console_init(void) {
+ return 0;
+}
#define MESON_SERIAL_CONSOLE NULL
#endif
@@ -824,6 +826,10 @@ static int __init meson_uart_init(void)
{
int ret;
+ ret = meson_serial_console_init();
+ if (ret)
+ return ret;
+
ret = uart_register_driver(&meson_uart_driver);
if (ret)
return ret;
--
2.29.2
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] tty: serial: meson: enable console as module
2020-12-11 0:57 ` Kevin Hilman
(?)
@ 2020-12-11 7:35 ` Greg Kroah-Hartman
-1 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-12-11 7:35 UTC (permalink / raw)
To: Kevin Hilman
Cc: linux-serial, Jiri Slaby, Neil Armstrong, Jerome Brunet,
Martin Blumenstingl, open list,
moderated list:ARM/Amlogic Meson SoC support,
open list:ARM/Amlogic Meson SoC support
On Thu, Dec 10, 2020 at 04:57:44PM -0800, Kevin Hilman wrote:
> Enable serial driver to be built as a module. To do so, init the
> console support on driver/module load instead of using
> console_initcall().
>
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---
> Yes, I'm well aware that having the serial console as a module makes
> devices hard to debug, so I'm not changing any default behavior. The
> goal is just to enable building as a module for environments where
> serial debug is not available or needed.
It's a good goal, I'm all for it, thanks for the patch!
greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tty: serial: meson: enable console as module
@ 2020-12-11 7:35 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-12-11 7:35 UTC (permalink / raw)
To: Kevin Hilman
Cc: Neil Armstrong, Martin Blumenstingl, open list, linux-serial,
open list:ARM/Amlogic Meson SoC support, Jiri Slaby,
moderated list:ARM/Amlogic Meson SoC support, Jerome Brunet
On Thu, Dec 10, 2020 at 04:57:44PM -0800, Kevin Hilman wrote:
> Enable serial driver to be built as a module. To do so, init the
> console support on driver/module load instead of using
> console_initcall().
>
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---
> Yes, I'm well aware that having the serial console as a module makes
> devices hard to debug, so I'm not changing any default behavior. The
> goal is just to enable building as a module for environments where
> serial debug is not available or needed.
It's a good goal, I'm all for it, thanks for the patch!
greg k-h
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] tty: serial: meson: enable console as module
@ 2020-12-11 7:35 ` Greg Kroah-Hartman
0 siblings, 0 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2020-12-11 7:35 UTC (permalink / raw)
To: Kevin Hilman
Cc: Neil Armstrong, Martin Blumenstingl, open list, linux-serial,
open list:ARM/Amlogic Meson SoC support, Jiri Slaby,
moderated list:ARM/Amlogic Meson SoC support, Jerome Brunet
On Thu, Dec 10, 2020 at 04:57:44PM -0800, Kevin Hilman wrote:
> Enable serial driver to be built as a module. To do so, init the
> console support on driver/module load instead of using
> console_initcall().
>
> Signed-off-by: Kevin Hilman <khilman@baylibre.com>
> ---
> Yes, I'm well aware that having the serial console as a module makes
> devices hard to debug, so I'm not changing any default behavior. The
> goal is just to enable building as a module for environments where
> serial debug is not available or needed.
It's a good goal, I'm all for it, thanks for the patch!
greg k-h
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-12-11 7:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-11 0:57 [PATCH] tty: serial: meson: enable console as module Kevin Hilman
2020-12-11 0:57 ` Kevin Hilman
2020-12-11 0:57 ` Kevin Hilman
2020-12-11 7:35 ` Greg Kroah-Hartman
2020-12-11 7:35 ` Greg Kroah-Hartman
2020-12-11 7:35 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.