Commit 4d38e5c4 authored by James Hogan's avatar James Hogan Committed by Paul Gortmaker

tty/metag_da: Avoid module_init/module_exit in non-modular code

The metag_da TTY driver can't get built as a module at the moment, but
it still uses module_init() and module_exit(). Those macros are moving
to module.h which isn't included by metag_da.c, which will result in the
following build warnings (remarkably no build errors) and an apparent
failure to boot as the TTY driver won't be loaded.

drivers/tty/metag_da.c:660: warning: data definition has no type or storage class
drivers/tty/metag_da.c:660: warning: type defaults to ‘int’ in declaration of ‘module_init’
drivers/tty/metag_da.c:660: warning: parameter names (without types) in function declaration
drivers/tty/metag_da.c:661: warning: data definition has no type or storage class
drivers/tty/metag_da.c:661: warning: type defaults to ‘int’ in declaration of ‘module_exit’
drivers/tty/metag_da.c:661: warning: parameter names (without types) in function declaration
drivers/tty/metag_da.c:572: warning: ‘dashtty_init’ defined but not used
drivers/tty/metag_da.c:645: warning: ‘dashtty_exit’ defined but not used
drivers/tty/metag_da.c In function ‘dash_console_write’:
drivers/tty/metag_da.c:670 : warning: passing argument 4 of ‘chancall’ discards qualifiers from pointer target type

Instead of just adding the module.h include, now would be a good time to
remove the use of these macros, replacing the module_init with
device_initcall, and removing the exit function altogether since it
isn't needed. If module support is added later the code can always be
resurrected.
Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarJames Hogan <james.hogan@imgtec.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-metag@vger.kernel.org
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
parent 791ed0bb
...@@ -640,25 +640,7 @@ static int __init dashtty_init(void) ...@@ -640,25 +640,7 @@ static int __init dashtty_init(void)
put_tty_driver(channel_driver); put_tty_driver(channel_driver);
return ret; return ret;
} }
device_initcall(dashtty_init);
static void dashtty_exit(void)
{
int nport;
struct dashtty_port *dport;
del_timer_sync(&put_timer);
kthread_stop(dashtty_thread);
del_timer_sync(&poll_timer);
tty_unregister_driver(channel_driver);
for (nport = 0; nport < NUM_TTY_CHANNELS; nport++) {
dport = &dashtty_ports[nport];
tty_port_destroy(&dport->port);
}
put_tty_driver(channel_driver);
}
module_init(dashtty_init);
module_exit(dashtty_exit);
#ifdef CONFIG_DA_CONSOLE #ifdef CONFIG_DA_CONSOLE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment