Re: [PATCH -next] tty: serial: imx: fix link error with CONFIG_SERIAL_CORE_CONSOLE=n

From: Yang Yingliang
Date: Fri Sep 18 2020 - 22:26:48 EST


Hi,

On 2020/9/18 19:16, Greg KH wrote:
On Fri, Sep 18, 2020 at 05:13:05PM +0800, Yang Yingliang wrote:
Fix the link error by selecting SERIAL_CORE_CONSOLE.

aarch64-linux-gnu-ld: drivers/tty/serial/imx_earlycon.o: in function `imx_uart_console_early_write':
imx_earlycon.c:(.text+0x84): undefined reference to `uart_console_write'

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
drivers/tty/serial/Kconfig | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 9631ccf43378..1044fc387691 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -521,6 +521,7 @@ config SERIAL_IMX_EARLYCON
depends on ARCH_MXC || COMPILE_TEST
depends on OF
select SERIAL_EARLYCON
+ select SERIAL_CORE_CONSOLE
help
If you have enabled the earlycon on the Freescale IMX
CPU you can make it the earlycon by answering Y to this option.
--
2.25.1

What caused this build error to start happening? Any pointers to the
specific commit?

It's start from 699cc4dfd140 ("tty: serial: imx: add imx earlycon driver"), the driver

uses the uart_console_write(), but SERIAL_CORE_CONSOLE is not selected, so uart_console_write

is not defined, then we get the error.


thanks,

greg k-h
.