Re: RocketPort Linux driver errors on module reload

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ferenc Wagner <wferi@...>
Cc: <linux-kernel@...>
Date: Monday, October 15, 2007 - 7:25 am

> -------------------- Start of forwarded message --------------------

Could you try the attached patch below?

--

diff --git a/drivers/char/rocket.c b/drivers/char/rocket.c
index 56cbba7..94bb3d0 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])
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
RocketPort Linux driver errors on module reload, Ferenc Wagner, (Mon Oct 15, 5:55 am)
Re: RocketPort Linux driver errors on module reload, Jiri Slaby, (Mon Oct 15, 7:25 am)
Re: RocketPort Linux driver errors on module reload, Ferenc Wagner, (Mon Oct 15, 8:57 am)
Re: RocketPort Linux driver errors on module reload, Jiri Slaby, (Mon Oct 15, 3:09 pm)
Re: RocketPort Linux driver errors on module reload, Wagner Ferenc, (Tue Oct 16, 3:47 am)
Re: RocketPort Linux driver errors on module reload, Jiri Slaby, (Tue Oct 16, 5:19 pm)
Re: RocketPort Linux driver errors on module reload, Ferenc Wagner, (Thu Oct 18, 5:53 pm)
Re: RocketPort Linux driver errors on module reload, Jiri Slaby, (Thu Oct 18, 6:08 pm)
Re: RocketPort Linux driver errors on module reload, Ferenc Wagner, (Thu Oct 18, 6:48 pm)