TTY: fix DTR not being dropped on hang up
[firefly-linux-kernel-4.4.55.git] / drivers / tty / mxser.c
index 484b6a3c9b03714a3eae559e061f3767cdc3af72..d996038eacfd3d43ca3583ff69d02a8736601ff9 100644 (file)
@@ -1084,6 +1084,10 @@ static void mxser_close(struct tty_struct *tty, struct file *filp)
        mutex_lock(&port->mutex);
        mxser_close_port(port);
        mxser_flush_buffer(tty);
+       if (test_bit(ASYNCB_INITIALIZED, &port->flags)) {
+               if (C_HUPCL(tty))
+                       tty_port_lower_dtr_rts(port);
+       }
        mxser_shutdown_port(port);
        clear_bit(ASYNCB_INITIALIZED, &port->flags);
        mutex_unlock(&port->mutex);