diff options
author | James Hogan <james.hogan@imgtec.com> | 2015-06-05 17:17:18 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2015-06-16 14:12:31 -0400 |
commit | 4d38e5c48f4095be21343869ad741676ab4e518f (patch) | |
tree | a9d262b4b764514a5064e6c0d0bfa9ec909d8d55 | |
parent | 791ed0bb5558dfdc4040563bd0b7dc24450fa732 (diff) |
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: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: James 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: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | drivers/tty/metag_da.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/tty/metag_da.c b/drivers/tty/metag_da.c index 3774600741d8..9325262289f9 100644 --- a/drivers/tty/metag_da.c +++ b/drivers/tty/metag_da.c | |||
@@ -640,25 +640,7 @@ err_destroy_ports: | |||
640 | put_tty_driver(channel_driver); | 640 | put_tty_driver(channel_driver); |
641 | return ret; | 641 | return ret; |
642 | } | 642 | } |
643 | 643 | device_initcall(dashtty_init); | |
644 | static void dashtty_exit(void) | ||
645 | { | ||
646 | int nport; | ||
647 | struct dashtty_port *dport; | ||
648 | |||
649 | del_timer_sync(&put_timer); | ||
650 | kthread_stop(dashtty_thread); | ||
651 | del_timer_sync(&poll_timer); | ||
652 | tty_unregister_driver(channel_driver); | ||
653 | for (nport = 0; nport < NUM_TTY_CHANNELS; nport++) { | ||
654 | dport = &dashtty_ports[nport]; | ||
655 | tty_port_destroy(&dport->port); | ||
656 | } | ||
657 | put_tty_driver(channel_driver); | ||
658 | } | ||
659 | |||
660 | module_init(dashtty_init); | ||
661 | module_exit(dashtty_exit); | ||
662 | 644 | ||
663 | #ifdef CONFIG_DA_CONSOLE | 645 | #ifdef CONFIG_DA_CONSOLE |
664 | 646 | ||