vserver 1.9.5.x5
[linux-2.6.git] / drivers / s390 / net / ctctty.c
index 6290b5c..a4fda34 100644 (file)
@@ -307,10 +307,7 @@ ctc_tty_tint(ctc_tty_info * info)
 
                info->flags &= ~CTC_ASYNC_TX_LINESTAT;
                if (tty) {
-                       if (wake && (tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-                           tty->ldisc.write_wakeup)
-                               (tty->ldisc.write_wakeup)(tty);
-                       wake_up_interruptible(&tty->write_wait);
+                       tty_wakeup(tty);
                }
        }
        return (skb_queue_empty(&info->tx_queue) ? 0 : 1);
@@ -492,7 +489,7 @@ ctc_tty_shutdown(ctc_tty_info * info)
  *  - If dialing, abort dial.
  */
 static int
-ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int count)
+ctc_tty_write(struct tty_struct *tty, const u_char * buf, int count)
 {
        int c;
        int total = 0;
@@ -509,8 +506,6 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
                total = -ENODEV;
                goto ex;
        }
-       if (from_user)
-               down(&info->write_sem);
        while (1) {
                struct sk_buff *skb;
                int skb_res;
@@ -529,11 +524,7 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
                        break;
                }
                skb_reserve(skb, skb_res);
-               if (from_user)
-                       copy_from_user(skb_put(skb, c),
-                                       (const u_char __user *)buf, c);
-               else
-                       memcpy(skb_put(skb, c), buf, c);
+               memcpy(skb_put(skb, c), buf, c);
                skb_queue_tail(&info->tx_queue, skb);
                buf += c;
                total += c;
@@ -543,8 +534,6 @@ ctc_tty_write(struct tty_struct *tty, int from_user, const u_char * buf, int cou
                info->lsr &= ~UART_LSR_TEMT;
                tasklet_schedule(&info->tasklet);
        }
-       if (from_user)
-               up(&info->write_sem);
 ex:
        DBF_TEXT(trace, 6, __FUNCTION__);
        return total;
@@ -589,9 +578,7 @@ ctc_tty_flush_buffer(struct tty_struct *tty)
        info->lsr |= UART_LSR_TEMT;
        spin_unlock_irqrestore(&ctc_tty_lock, flags);
        wake_up_interruptible(&tty->write_wait);
-       if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
-           tty->ldisc.write_wakeup)
-               (tty->ldisc.write_wakeup) (tty);
+       tty_wakeup(tty);
 ex:
        DBF_TEXT_(trace, 2, "ex: %s ", __FUNCTION__);
        return;
@@ -1066,8 +1053,7 @@ ctc_tty_close(struct tty_struct *tty, struct file *filp)
                skb_queue_purge(&info->tx_queue);
                info->lsr |= UART_LSR_TEMT;
        }
-       if (tty->ldisc.flush_buffer)
-               tty->ldisc.flush_buffer(tty);
+       tty_ldisc_flush(tty);
        info->tty = 0;
        tty->closing = 0;
        if (info->blocked_open) {