vserver 1.9.5.x5
[linux-2.6.git] / arch / alpha / kernel / srmcons.c
index 49c8c97..b5660fc 100644 (file)
@@ -22,7 +22,7 @@
 #include <asm/uaccess.h>
 
 
-static spinlock_t srmcons_callback_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(srmcons_callback_lock);
 static int srm_is_registered_console = 0;
 
 /* 
@@ -132,40 +132,11 @@ srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
 }
 
 static int
-srmcons_write(struct tty_struct *tty, int from_user,
+srmcons_write(struct tty_struct *tty,
              const unsigned char *buf, int count)
 {
        unsigned long flags;
 
-       if (from_user) {
-               char tmp[512];
-               int ret = 0;
-               size_t c;
-
-               while ((c = count) > 0) {
-                       if (c > sizeof(tmp))
-                               c = sizeof(tmp);
-                       
-                       c -= copy_from_user(tmp, (const char __user *) buf, c);
-
-                       if (!c) { 
-                               printk("%s: EFAULT (count %d)\n",
-                                      __FUNCTION__, count);
-                               return -EFAULT;
-                       }
-
-                       spin_lock_irqsave(&srmcons_callback_lock, flags);
-                       srmcons_do_write(tty, tmp, c);
-                       spin_unlock_irqrestore(&srmcons_callback_lock, flags);
-
-                       buf += c;
-                       count -= c;
-                       ret += c;
-               }
-
-               return ret;
-       }
-
        spin_lock_irqsave(&srmcons_callback_lock, flags);
        srmcons_do_write(tty, (const char *) buf, count);
        spin_unlock_irqrestore(&srmcons_callback_lock, flags);
@@ -189,7 +160,7 @@ static int
 srmcons_get_private_struct(struct srmcons_private **ps)
 {
        static struct srmcons_private *srmconsp = NULL;
-       static spinlock_t srmconsp_lock = SPIN_LOCK_UNLOCKED;
+       static DEFINE_SPINLOCK(srmconsp_lock);
        unsigned long flags;
        int retval = 0;
 
@@ -208,7 +179,7 @@ srmcons_get_private_struct(struct srmcons_private **ps)
                }
 
                srmconsp->tty = NULL;
-               srmconsp->lock = SPIN_LOCK_UNLOCKED;
+               spin_lock_init(&srmconsp->lock);
                init_timer(&srmconsp->timer);
 
                *ps = srmconsp;