Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm...
[firefly-linux-kernel-4.4.55.git] / drivers / tty / hvc / hvc_console.c
index eb255e807c0662250887beea86a2fb73081a6deb..9eba119bcdd3488d7d7541448a2371497c4d70f4 100644 (file)
@@ -361,7 +361,12 @@ static int hvc_open(struct tty_struct *tty, struct file * filp)
                tty->driver_data = NULL;
                tty_port_put(&hp->port);
                printk(KERN_ERR "hvc_open: request_irq failed with rc %d.\n", rc);
-       }
+       } else
+               /* We are ready... raise DTR/RTS */
+               if (C_BAUD(tty))
+                       if (hp->ops->dtr_rts)
+                               hp->ops->dtr_rts(hp, 1);
+
        /* Force wakeup of the polling thread */
        hvc_kick();
 
@@ -393,6 +398,10 @@ static void hvc_close(struct tty_struct *tty, struct file * filp)
                /* We are done with the tty pointer now. */
                tty_port_tty_set(&hp->port, NULL);
 
+               if (C_HUPCL(tty))
+                       if (hp->ops->dtr_rts)
+                               hp->ops->dtr_rts(hp, 0);
+
                if (hp->ops->notifier_del)
                        hp->ops->notifier_del(hp, hp->data);