diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index af1d46697e3f..e0082b73c198 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2590,12 +2590,13 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) goto out; } + /* Link the port to the driver state table and vice versa */ state->uart_port = uport; - state->pm_state = UART_PM_STATE_UNDEFINED; - - uport->cons = drv->cons; uport->state = state; + state->pm_state = UART_PM_STATE_UNDEFINED; + uport->cons = drv->cons; + /* * If this port is a console, then the spinlock is already * initialised.