Subject: Re: warnings from drivers/tty/ehv_bytechan.c

From: "[email-masked]" <[email-masked]>
Date: Fri, 24 Feb 2012 13:50:08 -0800

On Mon, Feb 20, 2012 at 01:24:22PM +0000, Tabi Timur-B04825 wrote:
> Stephen Rothwell wrote:
> > console_initcall() is not defined for modules.
> 
> Hmmm... the patch you posted is a good short-term fix, but I wonder if 
> makes sense for the driver to support modules at all.  I have this in the 
> driver:
> 
> #include <linux/module.h>
> ...
> module_init(ehv_bc_init);
> module_exit(ehv_bc_exit);
> 
> although to be honest, I can't remember the last time I tried to compile 
> it as a module.
> 
> The problem stems from the fact that it's a console driver *and* a tty 
> driver.  It makes sense that a tty driver can be compiled as a module, but 
> not a console driver.
> 
> So Greg, can I do something like this:
> 
> #ifdef MODULE
> module_initcall(ehv_bc_console_init)
> #else
> console_initcall(ehv_bc_console_init);
> #endif

Sure, something like that is fine, but if the code really can't be a
module, why not just fix the Kconfig file to enforce this properly
instead?

thanks,

greg k-h