warnings from drivers/tty/ehv_bytechan.c

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Sat Feb 25 08:50:08 EST 2012


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


More information about the Linuxppc-dev mailing list