Skip to contentSkip to conversation

tty: serial/8250: remove console dependency for mediatek

PATCH In review Arnd Bergmann 2 participants 2 messages May 19, 2015 – May 20, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tty: serial/8250: remove console dependency for mediatek

If the mediatek serial port driver is built-in, but serial console is disabled in Kconfig (e.g. when the serial driver itself is a loadable module), we get this build error:

drivers/built-in.o: In function `early_mtk8250_setup':
undefined reference to `early_serial8250_setup'

To avoid that problem, this patch encloses the early_mtk8250_setup function in #ifdef CONFIG_SERIAL_8250_CONSOLE, the same symbol that guards the early_serial8250_setup function.

drivers/tty/serial/8250/8250_mtk.c +2 -0
index 4488c2bdb7ba..78883ca64ddd 100644
@@ -305,6 +305,7 @@ static struct platform_driver mtk8250_platform_driver = {
 };
 module_platform_driver(mtk8250_platform_driver);
 
+#ifdef CONFIG_SERIAL_8250_CONSOLE
 static int __init early_mtk8250_setup(struct earlycon_device *device,
 					const char *options)
 {
@@ -317,6 +318,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device,
 }
 
 OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup);
+#endif
 
 MODULE_AUTHOR("Matthias Brugger");
 MODULE_LICENSE("GPL");
Acked-by on v1 1/1
#1 lore raw

Hi Arnd,

Quoted 27 lines · Arnd Bergmann

If the mediatek serial port driver is built-in, but serial console is disabled in Kconfig (e.g. when the serial driver itself is a loadable module), we get this build error:

drivers/built-in.o: In function `early_mtk8250_setup':
undefined reference to `early_serial8250_setup'

To avoid that problem, this patch encloses the early_mtk8250_setup function in #ifdef CONFIG_SERIAL_8250_CONSOLE, the same symbol that guards the early_serial8250_setup function.

drivers/tty/serial/8250/8250_mtk.c +1 -0
index 4488c2bdb7ba..78883ca64ddd 100644
@@ -305,6 +305,7 @@ static struct platform_driver mtk8250_platform_driver = {
 };
 module_platform_driver(mtk8250_platform_driver);
 
+#ifdef CONFIG_SERIAL_8250_CONSOLE
 static int __init early_mtk8250_setup(struct earlycon_device *device,
 					const char *options)
 {

drivers/tty/serial/8250/8250_mtk.c static int __init early_mtk8250_setup(struct earlycon_device *device, · line 324

Quoted 7 lines
drivers/tty/serial/8250/8250_mtk.c +1 -0
@@ -317,6 +318,7 @@ static int __init early_mtk8250_setup(struct earlycon_device *device,
 }
 
 OF_EARLYCON_DECLARE(mtk8250, "mediatek,mt6577-uart", early_mtk8250_setup);
+#endif
 
 MODULE_AUTHOR("Matthias Brugger");
 MODULE_LICENSE("GPL");

Thanks your correction.

Eddie