]> err.no Git - linux-2.6/blobdiff - drivers/char/isicom.c
drm/radeon: Restore sw interrupt on resume
[linux-2.6] / drivers / char / isicom.c
index 57b115272aaa8ff10df8217b3eb3f6ccf77ccd1a..4f3cefa8eb0e28cd0632983e66cebc63e5bb82ae 100644 (file)
@@ -813,15 +813,13 @@ static int isicom_setup_port(struct isi_port *port)
                return 0;
        if (!port->xmit_buf) {
                /* Relies on BKL */
-               void *xmit_buf = (void *)get_zeroed_page(GFP_KERNEL);
-
-               if (xmit_buf == NULL)
+               unsigned long page  = get_zeroed_page(GFP_KERNEL);
+               if (page == 0)
                        return -ENOMEM;
-               if (port->xmit_buf) {
-                       free_page((unsigned long)xmit_buf);
-                       return -ERESTARTSYS;
-               }
-               port->xmit_buf = xmit_buf;
+               if (port->xmit_buf)
+                       free_page(page);
+               else
+                       port->xmit_buf = (unsigned char *) page;
        }
 
        spin_lock_irqsave(&card->card_lock, flags);
@@ -1140,28 +1138,29 @@ static int isicom_write(struct tty_struct *tty, const unsigned char *buf,
 }
 
 /* put_char et all */
-static void isicom_put_char(struct tty_struct *tty, unsigned char ch)
+static int isicom_put_char(struct tty_struct *tty, unsigned char ch)
 {
        struct isi_port *port = tty->driver_data;
        struct isi_board *card = port->card;
        unsigned long flags;
 
        if (isicom_paranoia_check(port, tty->name, "isicom_put_char"))
-               return;
+               return 0;
 
        if (!port->xmit_buf)
-               return;
+               return 0;
 
        spin_lock_irqsave(&card->card_lock, flags);
-       if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1)
-               goto out;
+       if (port->xmit_cnt >= SERIAL_XMIT_SIZE - 1) {
+               spin_unlock_irqrestore(&card->card_lock, flags);
+               return 0;
+       }
 
        port->xmit_buf[port->xmit_head++] = ch;
        port->xmit_head &= (SERIAL_XMIT_SIZE - 1);
        port->xmit_cnt++;
        spin_unlock_irqrestore(&card->card_lock, flags);
-out:
-       return;
+       return 1;
 }
 
 /* flush_chars et all */