]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/cyclades.c
[PATCH] i2Output always takes kernel data now
[linux-2.6-omap-h63xx.git] / drivers / char / cyclades.c
index 122e7a72a4e178755dedce7922ff91b2f29a2f3e..e608dadece2fa0fa75878213c4012b99b1e1c28d 100644 (file)
@@ -633,7 +633,6 @@ static char rcsid[] =
 /*
  * Include section 
  */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -748,18 +747,6 @@ static struct cyclades_port cy_port[NR_PORTS];
 
 static int cy_next_channel; /* next minor available */
 
-/*
- * 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.  This buffer is
- * allocated when the first cy_open occurs.
- */
-static unsigned char *tmp_buf;
-
 /*
  * This is used to look up the divisor speeds and the timeouts
  * We're normally limited to 15 distinct baud rates.  The extra
@@ -1070,7 +1057,7 @@ detect_isa_irq(void __iomem *address)
    received, out buffer empty, modem change, etc.
  */
 static irqreturn_t
-cyy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+cyy_interrupt(int irq, void *dev_id)
 {
   struct tty_struct *tty;
   int status;
@@ -1815,7 +1802,7 @@ cyz_handle_cmd(struct cyclades_card *cinfo)
 
 #ifdef CONFIG_CYZ_INTR
 static irqreturn_t
-cyz_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+cyz_interrupt(int irq, void *dev_id)
 {
   struct cyclades_card *cinfo;
 
@@ -2467,7 +2454,6 @@ cy_open(struct tty_struct *tty, struct file * filp)
 {
   struct cyclades_port  *info;
   int retval, line;
-  unsigned long page;
 
     line = tty->index;
     if ((line < 0) || (NR_PORTS <= line)){
@@ -2546,15 +2532,6 @@ cy_open(struct tty_struct *tty, struct file * filp)
     printk("cyc:cy_open (%d): incrementing count to %d\n",
         current->pid, info->count);
 #endif
-    if (!tmp_buf) {
-       page = get_zeroed_page(GFP_KERNEL);
-       if (!page)
-           return -ENOMEM;
-       if (tmp_buf)
-           free_page(page);
-       else
-           tmp_buf = (unsigned char *) page;
-    }
 
     /*
      * If the port is the middle of closing, bail out now
@@ -2833,7 +2810,7 @@ cy_write(struct tty_struct * tty, const unsigned char *buf, int count)
         return 0;
     }
         
-    if (!info->xmit_buf || !tmp_buf)
+    if (!info->xmit_buf)
        return 0;
 
     CY_LOCK(info, flags);
@@ -4613,7 +4590,7 @@ cy_detect_isa(void)
 
                 /* allocate IRQ */
                 if(request_irq(cy_isa_irq, cyy_interrupt,
-                                  SA_INTERRUPT, "Cyclom-Y", &cy_card[j]))
+                                  IRQF_DISABLED, "Cyclom-Y", &cy_card[j]))
                 {
                         printk("Cyclom-Y/ISA found at 0x%lx ",
                                 (unsigned long) cy_isa_address);
@@ -4786,7 +4763,7 @@ cy_detect_pci(void)
 
                 /* allocate IRQ */
                 if(request_irq(cy_pci_irq, cyy_interrupt,
-                       SA_SHIRQ, "Cyclom-Y", &cy_card[j]))
+                       IRQF_SHARED, "Cyclom-Y", &cy_card[j]))
                 {
                         printk("Cyclom-Y/PCI found at 0x%lx ",
                            (ulong) cy_pci_phys2);
@@ -4966,7 +4943,7 @@ cy_detect_pci(void)
                 /* allocate IRQ only if board has an IRQ */
                if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
                    if(request_irq(cy_pci_irq, cyz_interrupt,
-                       SA_SHIRQ, "Cyclades-Z", &cy_card[j]))
+                       IRQF_SHARED, "Cyclades-Z", &cy_card[j]))
                    {
                         printk("Cyclom-8Zo/PCI found at 0x%lx ",
                            (ulong) cy_pci_phys2);
@@ -5060,7 +5037,7 @@ cy_detect_pci(void)
                 /* allocate IRQ only if board has an IRQ */
                if( (cy_pci_irq != 0) && (cy_pci_irq != 255) ) {
                    if(request_irq(cy_pci_irq, cyz_interrupt,
-                       SA_SHIRQ, "Cyclades-Z", &cy_card[j]))
+                       IRQF_SHARED, "Cyclades-Z", &cy_card[j]))
                    {
                         printk("Cyclom-Ze/PCI found at 0x%lx ",
                            (ulong) cy_pci_phys2);
@@ -5206,7 +5183,7 @@ done:
     extra ports are ignored.
  */
 
-static struct tty_operations cy_ops = {
+static const struct tty_operations cy_ops = {
     .open = cy_open,
     .close = cy_close,
     .write = cy_write,
@@ -5250,7 +5227,6 @@ cy_init(void)
     cy_serial_driver->owner = THIS_MODULE;
     cy_serial_driver->driver_name = "cyclades";
     cy_serial_driver->name = "ttyC";
-    cy_serial_driver->devfs_name = "tts/C";
     cy_serial_driver->major = CYCLADES_MAJOR;
     cy_serial_driver->minor_start = 0;
     cy_serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
@@ -5492,10 +5468,6 @@ cy_cleanup_module(void)
 #endif
         }
     }
-    if (tmp_buf) {
-       free_page((unsigned long) tmp_buf);
-       tmp_buf = NULL;
-    }
 } /* cy_cleanup_module */
 
 module_init(cy_init);