aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/hvc/hvc_xen.c1
-rw-r--r--drivers/tty/n_tty.c46
-rw-r--r--drivers/tty/serial/imx.c3
-rw-r--r--drivers/tty/serial/vt8500_serial.c5
4 files changed, 30 insertions, 25 deletions
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index e61c36cbb866..c193af6a628f 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -636,6 +636,7 @@ struct console xenboot_console = {
636 .name = "xenboot", 636 .name = "xenboot",
637 .write = xenboot_write_console, 637 .write = xenboot_write_console,
638 .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME, 638 .flags = CON_PRINTBUFFER | CON_BOOT | CON_ANYTIME,
639 .index = -1,
639}; 640};
640#endif /* CONFIG_EARLY_PRINTK */ 641#endif /* CONFIG_EARLY_PRINTK */
641 642
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 01bf5eb4f238..7a744b69c3d1 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2183,28 +2183,34 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,
2183 2183
2184 if (!input_available_p(tty, 0)) { 2184 if (!input_available_p(tty, 0)) {
2185 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { 2185 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) {
2186 retval = -EIO; 2186 up_read(&tty->termios_rwsem);
2187 break; 2187 tty_flush_to_ldisc(tty);
2188 } 2188 down_read(&tty->termios_rwsem);
2189 if (tty_hung_up_p(file)) 2189 if (!input_available_p(tty, 0)) {
2190 break; 2190 retval = -EIO;
2191 if (!timeout) 2191 break;
2192 break; 2192 }
2193 if (file->f_flags & O_NONBLOCK) { 2193 } else {
2194 retval = -EAGAIN; 2194 if (tty_hung_up_p(file))
2195 break; 2195 break;
2196 } 2196 if (!timeout)
2197 if (signal_pending(current)) { 2197 break;
2198 retval = -ERESTARTSYS; 2198 if (file->f_flags & O_NONBLOCK) {
2199 break; 2199 retval = -EAGAIN;
2200 } 2200 break;
2201 n_tty_set_room(tty); 2201 }
2202 up_read(&tty->termios_rwsem); 2202 if (signal_pending(current)) {
2203 retval = -ERESTARTSYS;
2204 break;
2205 }
2206 n_tty_set_room(tty);
2207 up_read(&tty->termios_rwsem);
2203 2208
2204 timeout = schedule_timeout(timeout); 2209 timeout = schedule_timeout(timeout);
2205 2210
2206 down_read(&tty->termios_rwsem); 2211 down_read(&tty->termios_rwsem);
2207 continue; 2212 continue;
2213 }
2208 } 2214 }
2209 __set_current_state(TASK_RUNNING); 2215 __set_current_state(TASK_RUNNING);
2210 2216
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index a0ebbc9ce5cd..042aa077b5b3 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1912,9 +1912,6 @@ static int serial_imx_probe_dt(struct imx_port *sport,
1912 1912
1913 sport->devdata = of_id->data; 1913 sport->devdata = of_id->data;
1914 1914
1915 if (of_device_is_stdout_path(np))
1916 add_preferred_console(imx_reg.cons->name, sport->port.line, 0);
1917
1918 return 0; 1915 return 0;
1919} 1916}
1920#else 1917#else
diff --git a/drivers/tty/serial/vt8500_serial.c b/drivers/tty/serial/vt8500_serial.c
index 93b697a0de65..15ad6fcda88b 100644
--- a/drivers/tty/serial/vt8500_serial.c
+++ b/drivers/tty/serial/vt8500_serial.c
@@ -561,12 +561,13 @@ static int vt8500_serial_probe(struct platform_device *pdev)
561 if (!mmres || !irqres) 561 if (!mmres || !irqres)
562 return -ENODEV; 562 return -ENODEV;
563 563
564 if (np) 564 if (np) {
565 port = of_alias_get_id(np, "serial"); 565 port = of_alias_get_id(np, "serial");
566 if (port >= VT8500_MAX_PORTS) 566 if (port >= VT8500_MAX_PORTS)
567 port = -1; 567 port = -1;
568 else 568 } else {
569 port = -1; 569 port = -1;
570 }
570 571
571 if (port < 0) { 572 if (port < 0) {
572 /* calculate the port id */ 573 /* calculate the port id */