Merge branches 'x86-ras-for-linus', 'x86-uv-for-linus' and 'x86-vdso-for-linus' of...
[cascardo/linux.git] / drivers / tty / synclink_gt.c
index c359a91..0e8c39b 100644 (file)
@@ -673,7 +673,7 @@ static int open(struct tty_struct *tty, struct file *filp)
        DBGINFO(("%s open, old ref count = %d\n", info->device_name, info->port.count));
 
        /* If port is closing, signal caller to try again */
-       if (tty_hung_up_p(filp) || info->port.flags & ASYNC_CLOSING){
+       if (info->port.flags & ASYNC_CLOSING){
                wait_event_interruptible_tty(tty, info->port.close_wait,
                                             !(info->port.flags & ASYNC_CLOSING));
                retval = ((info->port.flags & ASYNC_HUP_NOTIFY) ?
@@ -3273,7 +3273,6 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
        DECLARE_WAITQUEUE(wait, current);
        int             retval;
        bool            do_clocal = false;
-       bool            extra_count = false;
        unsigned long   flags;
        int             cd;
        struct tty_port *port = &info->port;
@@ -3300,10 +3299,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
        add_wait_queue(&port->open_wait, &wait);
 
        spin_lock_irqsave(&info->lock, flags);
-       if (!tty_hung_up_p(filp)) {
-               extra_count = true;
-               port->count--;
-       }
+       port->count--;
        spin_unlock_irqrestore(&info->lock, flags);
        port->blocked_open++;
 
@@ -3338,7 +3334,7 @@ static int block_til_ready(struct tty_struct *tty, struct file *filp,
        set_current_state(TASK_RUNNING);
        remove_wait_queue(&port->open_wait, &wait);
 
-       if (extra_count)
+       if (!tty_hung_up_p(filp))
                port->count++;
        port->blocked_open--;
 
@@ -3387,12 +3383,11 @@ static int alloc_desc(struct slgt_info *info)
        unsigned int pbufs;
 
        /* allocate memory to hold descriptor lists */
-       info->bufs = pci_alloc_consistent(info->pdev, DESC_LIST_SIZE, &info->bufs_dma_addr);
+       info->bufs = pci_zalloc_consistent(info->pdev, DESC_LIST_SIZE,
+                                          &info->bufs_dma_addr);
        if (info->bufs == NULL)
                return -ENOMEM;
 
-       memset(info->bufs, 0, DESC_LIST_SIZE);
-
        info->rbufs = (struct slgt_desc*)info->bufs;
        info->tbufs = ((struct slgt_desc*)info->bufs) + info->rbuf_count;