diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2007-10-18 03:06:26 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-11-16 09:30:24 -0800 |
commit | 76d41df34060a0e464a4e451f00610fd816c030e (patch) | |
tree | 9952d54cf11bcd82f56fea819992d98846cfa88d | |
parent | 236fc43928d4aa33065d41ee830896b56e45c477 (diff) | |
download | lwn-76d41df34060a0e464a4e451f00610fd816c030e.tar.gz lwn-76d41df34060a0e464a4e451f00610fd816c030e.zip |
Char: rocket, fix dynamic_dev tty
patch ac6aec2f5683588361ab408cb3346b08c66bdfbe in mainline.
- register_device unconditionally (non-pci dependent) to have also isa
devices in /dev
- unregister devices on module removal
- don't set TTY_DRIVER_DYNAMIC_DEV twice (removed the one dependent on some
macro)
This is the substantial part of the patch and the previous point is for
not checking which devices to unregister and which not (simply register
and unregister all found no matter on which bus they are plugged).
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Ferenc Wagner <wferi@niif.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/char/rocket.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c index 56cbba7b6ec0..94bb3d0605ef 100644 --- a/drivers/char/rocket.c +++ b/drivers/char/rocket.c @@ -699,8 +699,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev) spin_lock_init(&info->slock); mutex_init(&info->write_mtx); rp_table[line] = info; - if (pci_dev) - tty_register_device(rocket_driver, line, &pci_dev->dev); + tty_register_device(rocket_driver, line, pci_dev ? &pci_dev->dev : + NULL); } /* @@ -2434,7 +2434,7 @@ static int __init rp_init(void) rocket_driver->init_termios.c_ispeed = 9600; rocket_driver->init_termios.c_ospeed = 9600; #ifdef ROCKET_SOFT_FLOW - rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; + rocket_driver->flags |= TTY_DRIVER_REAL_RAW; #endif tty_set_operations(rocket_driver, &rocket_ops); @@ -2491,10 +2491,14 @@ static void rp_cleanup_module(void) if (retval) printk(KERN_INFO "Error %d while trying to unregister " "rocketport driver\n", -retval); - put_tty_driver(rocket_driver); for (i = 0; i < MAX_RP_PORTS; i++) - kfree(rp_table[i]); + if (rp_table[i]) { + tty_unregister_device(rocket_driver, i); + kfree(rp_table[i]); + } + + put_tty_driver(rocket_driver); for (i = 0; i < NUM_BOARDS; i++) { if (rcktpt_io_addr[i] <= 0 || is_PCI[i]) |