aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/serial_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/serial_core.c')
-rw-r--r--drivers/tty/serial/serial_core.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 0f02351c9239..ece2049bd270 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1830,9 +1830,13 @@ uart_set_options(struct uart_port *port, struct console *co,
1830 /* 1830 /*
1831 * Ensure that the serial console lock is initialised 1831 * Ensure that the serial console lock is initialised
1832 * early. 1832 * early.
1833 * If this port is a console, then the spinlock is already
1834 * initialised.
1833 */ 1835 */
1834 spin_lock_init(&port->lock); 1836 if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) {
1835 lockdep_set_class(&port->lock, &port_lock_key); 1837 spin_lock_init(&port->lock);
1838 lockdep_set_class(&port->lock, &port_lock_key);
1839 }
1836 1840
1837 memset(&termios, 0, sizeof(struct ktermios)); 1841 memset(&termios, 0, sizeof(struct ktermios));
1838 1842