Skip to content

Commit

Permalink
tty: serial/8250: remove console dependency for mediatek
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Eddie Huang <eddie.huang@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Arnd Bergmann authored and Greg Kroah-Hartman committed May 24, 2015
1 parent 357d561 commit 7798ede
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/tty/serial/8250/8250_mtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
Expand Down

0 comments on commit 7798ede

Please sign in to comment.