aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJiri Slaby <jirislaby@gmail.com>2007-10-18 06:06:26 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-18 17:37:27 -0400
commitac6aec2f5683588361ab408cb3346b08c66bdfbe (patch)
treeef2a411348f11d49ef9eb5eeda6455f8f73b8e71 /drivers
parent8cf5a8c5729116d0d60815393ec9f1c0f0bc2df7 (diff)
Char: rocket, fix dynamic_dev tty
- 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) 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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/rocket.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index d790b08525b4..01ce0c7d30a9 100644
--- a/drivers/char/rocket.c
+++ b/drivers/char/rocket.c
@@ -700,8 +700,8 @@ static void init_r_port(int board, int aiop, int chan, struct pci_dev *pci_dev)
700 spin_lock_init(&info->slock); 700 spin_lock_init(&info->slock);
701 mutex_init(&info->write_mtx); 701 mutex_init(&info->write_mtx);
702 rp_table[line] = info; 702 rp_table[line] = info;
703 if (pci_dev) 703 tty_register_device(rocket_driver, line, pci_dev ? &pci_dev->dev :
704 tty_register_device(rocket_driver, line, &pci_dev->dev); 704 NULL);
705} 705}
706 706
707/* 707/*
@@ -2438,7 +2438,7 @@ static int __init rp_init(void)
2438 rocket_driver->init_termios.c_ispeed = 9600; 2438 rocket_driver->init_termios.c_ispeed = 9600;
2439 rocket_driver->init_termios.c_ospeed = 9600; 2439 rocket_driver->init_termios.c_ospeed = 9600;
2440#ifdef ROCKET_SOFT_FLOW 2440#ifdef ROCKET_SOFT_FLOW
2441 rocket_driver->flags |= TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV; 2441 rocket_driver->flags |= TTY_DRIVER_REAL_RAW;
2442#endif 2442#endif
2443 tty_set_operations(rocket_driver, &rocket_ops); 2443 tty_set_operations(rocket_driver, &rocket_ops);
2444 2444
@@ -2495,10 +2495,14 @@ static void rp_cleanup_module(void)
2495 if (retval) 2495 if (retval)
2496 printk(KERN_INFO "Error %d while trying to unregister " 2496 printk(KERN_INFO "Error %d while trying to unregister "
2497 "rocketport driver\n", -retval); 2497 "rocketport driver\n", -retval);
2498 put_tty_driver(rocket_driver);
2499 2498
2500 for (i = 0; i < MAX_RP_PORTS; i++) 2499 for (i = 0; i < MAX_RP_PORTS; i++)
2501 kfree(rp_table[i]); 2500 if (rp_table[i]) {
2501 tty_unregister_device(rocket_driver, i);
2502 kfree(rp_table[i]);
2503 }
2504
2505 put_tty_driver(rocket_driver);
2502 2506
2503 for (i = 0; i < NUM_BOARDS; i++) { 2507 for (i = 0; i < NUM_BOARDS; i++) {
2504 if (rcktpt_io_addr[i] <= 0 || is_PCI[i]) 2508 if (rcktpt_io_addr[i] <= 0 || is_PCI[i])