summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serdev
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-11-03 15:30:57 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-11-28 16:03:35 +0100
commit51899a63b42ee01df676b0624df4e81a517c3571 (patch)
tree62997d747d7211c833aeca077b797d566e5a7aad /drivers/tty/serdev
parentserdev: document driver callbacks (diff)
downloadlinux-51899a63b42ee01df676b0624df4e81a517c3571.tar.xz
linux-51899a63b42ee01df676b0624df4e81a517c3571.zip
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: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serdev')
-rw-r--r--drivers/tty/serdev/serdev-ttyport.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
index ce7ad0acee7a..f76a8e044e4e 100644
--- a/drivers/tty/serdev/serdev-ttyport.c
+++ b/drivers/tty/serdev/serdev-ttyport.c
@@ -104,6 +104,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 |
@@ -117,7 +119,6 @@ static int ttyport_open(struct serdev_controller *ctrl)
set_bit(SERPORT_ACTIVE, &serport->flags);
- tty_unlock(serport->tty);
return 0;
err_close: