···18081808 struct termios termios;18091809 int i;1810181018111811+ /*18121812+ * Ensure that the serial console lock is initialised18131813+ * early.18141814+ */18151815+ spin_lock_init(&port->lock);18161816+18111817 memset(&termios, 0, sizeof(struct termios));1812181818131819 termios.c_cflag = CREAD | HUPCL | CLOCAL;···2202219622032197 state->port = port;2204219822052205- spin_lock_init(&port->lock);22062199 port->cons = drv->cons;22072200 port->info = state->info;22012201+22022202+ /*22032203+ * If this port is a console, then the spinlock is already22042204+ * initialised.22052205+ */22062206+ if (!uart_console(port))22072207+ spin_lock_init(&port->lock);2208220822092209 uart_configure_port(drv, state, port);22102210