Re: [PATCH -next] printk: Export match_devname_and_update_preferred_console()

From: Petr Mladek
Date: Tue Sep 10 2024 - 02:41:50 EST


On Mon 2024-09-09 13:56:28, Tony Lindgren wrote:
> On Mon, Sep 09, 2024 at 11:25:58AM +0300, Tony Lindgren wrote:
> > On Mon, Sep 09, 2024 at 03:56:52PM +0800, Yu Liao wrote:
> > > When building serial_base as a module, modpost fails with the following
> > > error message:
> > >
> > > ERROR: modpost: "match_devname_and_update_preferred_console"
> > > [drivers/tty/serial/serial_base.ko] undefined!
> > >
> > > Export the symbol to allow using it from modules.
> >
> > I think the issue is with CONFIG_PRINTK is no set, and serial drivers
> > select SERIAL_CORE_CONSOLE? And when serial_base is a module, there is
> > no kernel console.
> >
> > I replied earlier today to the lkp error report along those lines, but
> > please let me know if there is more to the issue than that.
>
> Sorry I gave wrong information above. The issue can be hit also with
> CONFIG_PRINTK=y and serial_base as a loadable module.

Yes, this is my understanding. The problem has happened when serial_base
was built as a module. So exporting the symbol looks like the right fix.

Best Regards,
Petr