]> err.no Git - linux-2.6/blobdiff - drivers/char/serial167.c
Merge branch 'audit.b32' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/audit...
[linux-2.6] / drivers / char / serial167.c
index f36342ae8e7e91b7121162580d13f39faa176deb..f4809c8183ccd9acaf1dfe4dbbec145ff6700929 100644 (file)
@@ -44,7 +44,6 @@
  * - replace bottom half handler with task queue handler
  */
 
-#include <linux/config.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -119,18 +118,6 @@ struct cyclades_port cy_port[] = {
 };
 #define NR_PORTS        ARRAY_SIZE(cy_port)
 
-/*
- * tmp_buf is used as a temporary buffer by serial_write.  We need to
- * lock it in case the copy_from_user blocks while swapping in a page,
- * and some other program tries to do a serial write at the same time.
- * Since the lock will only come under contention when the system is
- * swapping and available memory is low, it makes sense to share one
- * buffer across all the serial ports, since it significantly saves
- * memory if large numbers of serial ports are open.
- */
-static unsigned char *tmp_buf = 0;
-DECLARE_MUTEX(tmp_buf_sem);
-
 /*
  * This is used to look up the divisor speeds and the timeouts
  * We're normally limited to 15 distinct baud rates.  The extra
@@ -1134,7 +1121,7 @@ cy_put_char(struct tty_struct *tty, unsigned char ch)
     if (serial_paranoia_check(info, tty->name, "cy_put_char"))
        return;
 
-    if (!tty || !info->xmit_buf)
+    if (!info->xmit_buf)
        return;
 
     local_irq_save(flags);
@@ -1200,7 +1187,7 @@ cy_write(struct tty_struct * tty,
        return 0;
     }
        
-    if (!tty || !info->xmit_buf || !tmp_buf){
+    if (!info->xmit_buf){
         return 0;
     }
 
@@ -1985,13 +1972,6 @@ cy_open(struct tty_struct *tty, struct file * filp)
     tty->driver_data = info;
     info->tty = tty;
 
-    if (!tmp_buf) {
-       tmp_buf = (unsigned char *) get_zeroed_page(GFP_KERNEL);
-       if (!tmp_buf){
-           return -ENOMEM;
-        }
-    }
-
     /*
      * Start up serial port
      */
@@ -2160,7 +2140,7 @@ mvme167_serial_console_setup(int cflag)
                                        rcor >> 5, rbpr);
 } /* serial_console_init */
 
-static struct tty_operations cy_ops = {
+static const struct tty_operations cy_ops = {
        .open = cy_open,
        .close = cy_close,
        .write = cy_write,
@@ -2236,7 +2216,6 @@ scrn[1] = '\0';
     /* Initialize the tty_driver structure */
     
     cy_serial_driver->owner = THIS_MODULE;
-    cy_serial_driver->devfs_name = "tts/";
     cy_serial_driver->name = "ttyS";
     cy_serial_driver->major = TTY_MAJOR;
     cy_serial_driver->minor_start = 64;