Commit b24313a8 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

ttyprintk: Allow built as a module

The driver is well written to be used as a module, just the exit call
is missing.
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7d1c2858
...@@ -40,7 +40,7 @@ config SGI_MBCS ...@@ -40,7 +40,7 @@ config SGI_MBCS
source "drivers/tty/serial/Kconfig" source "drivers/tty/serial/Kconfig"
config TTY_PRINTK config TTY_PRINTK
bool "TTY driver to output user messages via printk" tristate "TTY driver to output user messages via printk"
depends on EXPERT && TTY depends on EXPERT && TTY
default n default n
---help--- ---help---
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/tty.h> #include <linux/tty.h>
#include <linux/export.h> #include <linux/module.h>
struct ttyprintk_port { struct ttyprintk_port {
struct tty_port port; struct tty_port port;
...@@ -214,4 +214,15 @@ static int __init ttyprintk_init(void) ...@@ -214,4 +214,15 @@ static int __init ttyprintk_init(void)
tty_port_destroy(&tpk_port.port); tty_port_destroy(&tpk_port.port);
return ret; return ret;
} }
static void __exit ttyprintk_exit(void)
{
tty_unregister_driver(ttyprintk_driver);
put_tty_driver(ttyprintk_driver);
tty_port_destroy(&tpk_port.port);
}
device_initcall(ttyprintk_init); device_initcall(ttyprintk_init);
module_exit(ttyprintk_exit);
MODULE_LICENSE("GPL");
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