Commit 51899a63 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

serdev: ttyport: release tty lock sooner on open

Release the tty lock once tty-driver open returns to make it clear that
it does not protect neither tty->termios or the serport flags.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 10f9e033
...@@ -104,6 +104,8 @@ static int ttyport_open(struct serdev_controller *ctrl) ...@@ -104,6 +104,8 @@ static int ttyport_open(struct serdev_controller *ctrl)
if (ret) if (ret)
goto err_close; goto err_close;
tty_unlock(serport->tty);
/* Bring the UART into a known 8 bits no parity hw fc state */ /* Bring the UART into a known 8 bits no parity hw fc state */
ktermios = tty->termios; ktermios = tty->termios;
ktermios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | ktermios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP |
...@@ -117,7 +119,6 @@ static int ttyport_open(struct serdev_controller *ctrl) ...@@ -117,7 +119,6 @@ static int ttyport_open(struct serdev_controller *ctrl)
set_bit(SERPORT_ACTIVE, &serport->flags); set_bit(SERPORT_ACTIVE, &serport->flags);
tty_unlock(serport->tty);
return 0; return 0;
err_close: err_close:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment