Re: ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

From: Tony Lindgren
Date: Mon Sep 09 2024 - 01:54:27 EST


Hi,

On Sat, Sep 07, 2024 at 01:23:47PM +0800, kernel test robot wrote:
> Hi Tony,
>
> FYI, the error/warning still remains.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: b31c4492884252a8360f312a0ac2049349ddf603
> commit: 12c91cec3155f79216641162a32e04a59abb6e37 serial: core: Add serial_base_match_and_update_preferred_console()
> date: 9 weeks ago
> config: i386-buildonly-randconfig-004-20240907 (https://download.01.org/0day-ci/archive/20240907/202409071312.qlwtTOS1-lkp@xxxxxxxxx/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240907/202409071312.qlwtTOS1-lkp@xxxxxxxxx/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202409071312.qlwtTOS1-lkp@xxxxxxxxx/
>
> All errors (new ones prefixed by >>, old ones prefixed by <<):
...

> >> ERROR: modpost: "match_devname_and_update_preferred_console" [drivers/tty/serial/serial_base.ko] undefined!

Sorry I did not realize we still have an open build issue. I'll send a fix.

As the serial port devices drives can select SERIAL_CORE_CONSOLE, and
CONFIG_PRINTK may not be set we should check for both Kconfig options.

So if defined(CONFIG_SERIAL_CORE_CONSOLE) && defined(CONFIG_PRINTK).

Regards,

Tony