Char: cyclades, fix tty device unregister
authorJiri Slaby <jirislaby@gmail.com>
Tue, 8 May 2007 07:37:01 +0000 (00:37 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:25 +0000 (11:15 -0700)
put_tty_driver after unregistering devices

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/char/cyclades.c

index e559ce9e7147637b6b5825a1a38dbfb9b6f458c7..c6a12bad70f5fbb67504aacddefdf4b4740829a3 100644 (file)
@@ -5285,8 +5285,6 @@ static void __exit cy_cleanup_module(void)
                printk(KERN_ERR "failed to unregister Cyclades serial "
                                "driver(%d)\n", e1);
 
-       put_tty_driver(cy_serial_driver);
-
 #ifdef CONFIG_PCI
        pci_unregister_driver(&cy_pci_driver);
 #endif
@@ -5310,6 +5308,8 @@ static void __exit cy_cleanup_module(void)
                                tty_unregister_device(cy_serial_driver, e1);
                }
        }
+
+       put_tty_driver(cy_serial_driver);
 } /* cy_cleanup_module */
 
 module_init(cy_init);