@@ -278,7 +278,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
278278 */
279279
280280 retval = 0 ;
281- add_wait_queue (& self -> open_wait , & wait );
281+ add_wait_queue (& self -> port . open_wait , & wait );
282282
283283 IRDA_DEBUG (2 , "%s(%d):block_til_ready before block on %s open_count=%d\n" ,
284284 __FILE__ ,__LINE__ , tty -> driver -> name , self -> open_count );
@@ -336,7 +336,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
336336 }
337337
338338 __set_current_state (TASK_RUNNING );
339- remove_wait_queue (& self -> open_wait , & wait );
339+ remove_wait_queue (& self -> port . open_wait , & wait );
340340
341341 if (extra_count ) {
342342 /* ++ is not atomic, so this should be protected - Jean II */
@@ -381,6 +381,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
381381 return - ENOMEM ;
382382 }
383383
384+ tty_port_init (& self -> port );
384385 self -> magic = IRCOMM_TTY_MAGIC ;
385386 self -> flow = FLOW_STOP ;
386387
@@ -393,8 +394,6 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
393394
394395 /* Init some important stuff */
395396 init_timer (& self -> watchdog_timer );
396- init_waitqueue_head (& self -> open_wait );
397- init_waitqueue_head (& self -> close_wait );
398397 spin_lock_init (& self -> spinlock );
399398
400399 /*
@@ -408,6 +407,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
408407 tty -> termios -> c_oflag = 0 ;
409408
410409 /* Insert into hash */
410+ /* FIXME there is a window from find to here */
411411 hashbin_insert (ircomm_tty , (irda_queue_t * ) self , line , NULL );
412412 }
413413 /* ++ is not atomic, so this should be protected - Jean II */
@@ -438,7 +438,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
438438 * probably better sleep uninterruptible?
439439 */
440440
441- if (wait_event_interruptible (self -> close_wait , !test_bit (ASYNC_B_CLOSING , & self -> flags ))) {
441+ if (wait_event_interruptible (self -> port .close_wait ,
442+ !test_bit (ASYNC_B_CLOSING , & self -> flags ))) {
442443 IRDA_WARNING ("%s - got signal while blocking on ASYNC_CLOSING!\n" ,
443444 __func__ );
444445 return - ERESTARTSYS ;
@@ -559,11 +560,11 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp)
559560 if (self -> blocked_open ) {
560561 if (self -> close_delay )
561562 schedule_timeout_interruptible (self -> close_delay );
562- wake_up_interruptible (& self -> open_wait );
563+ wake_up_interruptible (& self -> port . open_wait );
563564 }
564565
565566 self -> flags &= ~(ASYNC_NORMAL_ACTIVE |ASYNC_CLOSING );
566- wake_up_interruptible (& self -> close_wait );
567+ wake_up_interruptible (& self -> port . close_wait );
567568}
568569
569570/*
@@ -1011,7 +1012,7 @@ static void ircomm_tty_hangup(struct tty_struct *tty)
10111012 self -> open_count = 0 ;
10121013 spin_unlock_irqrestore (& self -> spinlock , flags );
10131014
1014- wake_up_interruptible (& self -> open_wait );
1015+ wake_up_interruptible (& self -> port . open_wait );
10151016}
10161017
10171018/*
@@ -1084,7 +1085,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
10841085 (status & IRCOMM_CD ) ? "on" : "off" );
10851086
10861087 if (status & IRCOMM_CD ) {
1087- wake_up_interruptible (& self -> open_wait );
1088+ wake_up_interruptible (& self -> port . open_wait );
10881089 } else {
10891090 IRDA_DEBUG (2 ,
10901091 "%s(), Doing serial hangup..\n" , __func__ );
@@ -1103,7 +1104,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
11031104 tty -> hw_stopped = 0 ;
11041105
11051106 /* Wake up processes blocked on open */
1106- wake_up_interruptible (& self -> open_wait );
1107+ wake_up_interruptible (& self -> port . open_wait );
11071108
11081109 schedule_work (& self -> tqueue );
11091110 return ;
0 commit comments