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

From: Tabi Timur-B04825 <[email-masked]>
Date: Mon, 20 Feb 2012 13:24:22 +0000

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=20
makes sense for the driver to support modules at all.  I have this in the=20
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=20
it as a module.

The problem stems from the fact that it's a console driver *and* a tty=20
driver.  It makes sense that a tty driver can be compiled as a module, but=
=20
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

--=20
Timur Tabi
Linux kernel developer at Freescale=