-In order to remove a line discipline call tty_register_ldisc passing NULL.+In order to remove a line discipline call tty_unregister_ldisc(). In ancient times this always worked. In modern times the function will return -EBUSY if the ldisc is currently in use. Since the ldisc referencing code manages the module counts this should not usually be a concern.diff -uprN linux-tty_register_ldisc_000/drivers/char/tty_io.c linux-tty_register_ldisc_001/drivers/char/tty_io.c--- linux-tty_register_ldisc_000/drivers/char/tty_io.c 2005-05-31 20:13:34.000000000 +0400+++ linux-tty_register_ldisc_001/drivers/char/tty_io.c 2005-05-31 23:17:40.000000000 +0400@@ -262,17 +262,10 @@ int tty_register_ldisc(int disc, struct return -EINVAL;