Driver/tiny_tty/tiny_exit()

Last-modified: 2007-09-21 (金) 19:37:52

564 :static void __exit tiny_exit(void)
565 :{
566 : struct tiny_serial *tiny;
567 : int i;
568 :
569 : for (i = 0; i < TINY_TTY_MINORS; ++i)
570 : tty_unregister_device(tiny_tty_driver, i);
571 : tty_unregister_driver(tiny_tty_driver);
572 :
573 : /* shut down all of the timers and free the memory */
574 : for (i = 0; i < TINY_TTY_MINORS; ++i) {
575 : tiny = tiny_table[i];
576 : if (tiny) {
577 : /* close the port */
578 : while (tiny->open_count)
579 : do_close(tiny);
580 :
581 : /* shut down our timer and free the memory */
582 : del_timer(tiny->timer);
583 : kfree(tiny->timer);
584 : kfree(tiny);
585 : tiny_table[i] = NULL;
586 : }
587 : }
588 :}