aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/n_hdlc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/n_hdlc.c')
-rw-r--r--drivers/char/n_hdlc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/n_hdlc.c b/drivers/char/n_hdlc.c
index c68118efad84..47d32281032c 100644
--- a/drivers/char/n_hdlc.c
+++ b/drivers/char/n_hdlc.c
@@ -598,18 +598,18 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
598 return -EFAULT; 598 return -EFAULT;
599 } 599 }
600 600
601 lock_kernel(); 601 tty_lock();
602 602
603 for (;;) { 603 for (;;) {
604 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { 604 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
605 unlock_kernel(); 605 tty_unlock();
606 return -EIO; 606 return -EIO;
607 } 607 }
608 608
609 n_hdlc = tty2n_hdlc (tty); 609 n_hdlc = tty2n_hdlc (tty);
610 if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC || 610 if (!n_hdlc || n_hdlc->magic != HDLC_MAGIC ||
611 tty != n_hdlc->tty) { 611 tty != n_hdlc->tty) {
612 unlock_kernel(); 612 tty_unlock();
613 return 0; 613 return 0;
614 } 614 }
615 615
@@ -619,13 +619,13 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
619 619
620 /* no data */ 620 /* no data */
621 if (file->f_flags & O_NONBLOCK) { 621 if (file->f_flags & O_NONBLOCK) {
622 unlock_kernel(); 622 tty_unlock();
623 return -EAGAIN; 623 return -EAGAIN;
624 } 624 }
625 625
626 interruptible_sleep_on (&tty->read_wait); 626 interruptible_sleep_on (&tty->read_wait);
627 if (signal_pending(current)) { 627 if (signal_pending(current)) {
628 unlock_kernel(); 628 tty_unlock();
629 return -EINTR; 629 return -EINTR;
630 } 630 }
631 } 631 }
@@ -648,7 +648,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
648 kfree(rbuf); 648 kfree(rbuf);
649 else 649 else
650 n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,rbuf); 650 n_hdlc_buf_put(&n_hdlc->rx_free_buf_list,rbuf);
651 unlock_kernel(); 651 tty_unlock();
652 return ret; 652 return ret;
653 653
654} /* end of n_hdlc_tty_read() */ 654} /* end of n_hdlc_tty_read() */
@@ -691,7 +691,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
691 count = maxframe; 691 count = maxframe;
692 } 692 }
693 693
694 lock_kernel(); 694 tty_lock();
695 695
696 add_wait_queue(&tty->write_wait, &wait); 696 add_wait_queue(&tty->write_wait, &wait);
697 set_current_state(TASK_INTERRUPTIBLE); 697 set_current_state(TASK_INTERRUPTIBLE);
@@ -731,7 +731,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
731 n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf); 731 n_hdlc_buf_put(&n_hdlc->tx_buf_list,tbuf);
732 n_hdlc_send_frames(n_hdlc,tty); 732 n_hdlc_send_frames(n_hdlc,tty);
733 } 733 }
734 unlock_kernel(); 734 tty_unlock();
735 return error; 735 return error;
736 736
737} /* end of n_hdlc_tty_write() */ 737} /* end of n_hdlc_tty_write() */