vserver 1.9.5.x5
[linux-2.6.git] / drivers / s390 / char / con3215.c
index 0e724c8..022f17b 100644 (file)
@@ -102,7 +102,7 @@ struct raw3215_info {
 /* array of 3215 devices structures */
 static struct raw3215_info *raw3215[NR_3215];
 /* spinlock to protect the raw3215 array */
-static spinlock_t raw3215_device_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(raw3215_device_lock);
 /* list of free request structures */
 static struct raw3215_req *raw3215_freelist;
 /* spinlock to protect free list */
@@ -366,10 +366,7 @@ raw3215_tasklet(void *data)
        tty = raw->tty;
        if (tty != NULL &&
            RAW3215_BUFFER_SIZE - raw->count >= RAW3215_MIN_SPACE) {
-               if ((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);
        }
 }
 
@@ -986,34 +983,16 @@ tty3215_write_room(struct tty_struct *tty)
  * String write routine for 3215 ttys
  */
 static int
-tty3215_write(struct tty_struct * tty, int from_user,
+tty3215_write(struct tty_struct * tty,
              const unsigned char *buf, int count)
 {
        struct raw3215_info *raw;
-       int length, ret;
 
        if (!tty)
                return 0;
        raw = (struct raw3215_info *) tty->driver_data;
-       if (!from_user) {
-               raw3215_write(raw, buf, count);
-               return count;
-       }
-       ret = 0;
-       while (count > 0) {
-               length = count < 80 ? count : 80;
-               length -= copy_from_user(raw->ubuffer, buf, length);
-               if (length == 0) {
-                       if (!ret)
-                               ret = -EFAULT;
-                       break;
-               }
-               raw3215_write(raw, raw->ubuffer, count);
-               buf += length;
-               count -= length;
-               ret += length;
-       }
-       return ret;
+       raw3215_write(raw, buf, count);
+       return count;
 }
 
 /*
@@ -1054,10 +1033,7 @@ tty3215_flush_buffer(struct tty_struct *tty)
 
        raw = (struct raw3215_info *) tty->driver_data;
        raw3215_flush_buffer(raw);
-       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);
 }
 
 /*