Driver/tiny_tty/do_close()

Last-modified: 2007-09-26 (水) 14:23:45

145 :static void do_close(struct tiny_serial *tiny)
146 :{
147 : down(&tiny->sem);
148 :
149 : if (!tiny->open_count) {
150 : /* port was never opened */
151 : goto exit;
152 : }
153 :
154 : --tiny->open_count;
155 : if (tiny->open_count <= 0) {
156 : /* The port is being closed by the last user. */
157 : /* Do any hardware specific stuff here */
158 :
159 : /* shut down our timer */
160 : del_timer(tiny->timer);
161 : }
162 :exit:
163 : up(&tiny->sem);
164 :}