]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/usb/serial/whiteheat.c
Merge branch 'irq-cleanups-upstream' of git://git.kernel.org/pub/scm/linux/kernel...
[karo-tx-linux.git] / drivers / usb / serial / whiteheat.c
index ee5dd8b5a7131b23846d153586686f1163fa7dec..38726ef3132b70d83121d8bdaa894b47990f0843 100644 (file)
@@ -610,8 +610,7 @@ static int whiteheat_open (struct usb_serial_port *port, struct file *filp)
        if (retval)
                goto exit;
 
-       if (port->tty)
-               port->tty->low_latency = 1;
+       port->tty->low_latency = 1;
 
        /* send an open port command */
        retval = firm_open(port);
@@ -659,11 +658,14 @@ static void whiteheat_close(struct usb_serial_port *port, struct file * filp)
        struct list_head *tmp2;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
-       
+
+       mutex_lock(&port->serial->disc_mutex);
        /* filp is NULL when called from usb_serial_disconnect */
-       if (filp && (tty_hung_up_p(filp))) {
+       if ((filp && (tty_hung_up_p(filp))) || port->serial->disconnected) {
+               mutex_unlock(&port->serial->disc_mutex);
                return;
        }
+       mutex_unlock(&port->serial->disc_mutex);
 
        port->tty->closing = 1;