Messages in this thread Patch in this message | | | From | Johan Hovold <> | Subject | [PATCH 6/8] serdev: ttyport: release tty lock sooner on open | Date | Fri, 3 Nov 2017 15:30:57 +0100 |
| |
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: Johan Hovold <johan@kernel.org> --- drivers/tty/serdev/serdev-ttyport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c index 334bce00364f..a8ddcd2ac5ea 100644 --- a/drivers/tty/serdev/serdev-ttyport.c +++ b/drivers/tty/serdev/serdev-ttyport.c @@ -130,6 +130,8 @@ static int ttyport_open(struct serdev_controller *ctrl) if (ret) goto err_close; + tty_unlock(serport->tty); + /* Bring the UART into a known 8 bits no parity hw fc state */ ktermios = tty->termios; ktermios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | @@ -143,7 +145,6 @@ static int ttyport_open(struct serdev_controller *ctrl) set_bit(SERPORT_ACTIVE, &serport->flags); - tty_unlock(serport->tty); return 0; err_close: -- 2.15.0
| |