aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-12-09 13:18:24 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-12-09 13:18:24 -0500
commit50a5528a4b19b7324f0796ea2fedf32530a11ff8 (patch)
tree185a023ee6c30da3744ac3ddb610f88e432fdc65 /drivers/tty/tty_io.c
parentbc4caf186fb691ad56adbe578d356a262f3a7d10 (diff)
parent3caad34eab57e622dad48086af7f89c19001664e (diff)
Merge tag 'usb-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB fixes from Greg KH: "Here are some small USB fixes for 4.20-rc6 The "largest" here are some xhci fixes for reported issues. Also here is a USB core fix, some quirk additions, and a usb-serial fix which required the export of one of the tty layer's functions to prevent code duplication. The tty maintainer agreed with this change. All of these have been in linux-next with no reported issues" * tag 'usb-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: xhci: Prevent U1/U2 link pm states if exit latency is too long xhci: workaround CSS timeout on AMD SNPS 3.0 xHC USB: check usb_get_extra_descriptor for proper size USB: serial: console: fix reported terminal settings usb: quirk: add no-LPM quirk on SanDisk Ultra Flair device USB: Fix invalid-free bug in port_over_current_notify() usb: appledisplay: Add 27" Apple Cinema Display
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r--drivers/tty/tty_io.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index ee80dfbd5442..687250ec8032 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1373,7 +1373,13 @@ err_release_lock:
1373 return ERR_PTR(retval); 1373 return ERR_PTR(retval);
1374} 1374}
1375 1375
1376static void tty_free_termios(struct tty_struct *tty) 1376/**
1377 * tty_save_termios() - save tty termios data in driver table
1378 * @tty: tty whose termios data to save
1379 *
1380 * Locking: Caller guarantees serialisation with tty_init_termios().
1381 */
1382void tty_save_termios(struct tty_struct *tty)
1377{ 1383{
1378 struct ktermios *tp; 1384 struct ktermios *tp;
1379 int idx = tty->index; 1385 int idx = tty->index;
@@ -1392,6 +1398,7 @@ static void tty_free_termios(struct tty_struct *tty)
1392 } 1398 }
1393 *tp = tty->termios; 1399 *tp = tty->termios;
1394} 1400}
1401EXPORT_SYMBOL_GPL(tty_save_termios);
1395 1402
1396/** 1403/**
1397 * tty_flush_works - flush all works of a tty/pty pair 1404 * tty_flush_works - flush all works of a tty/pty pair
@@ -1491,7 +1498,7 @@ static void release_tty(struct tty_struct *tty, int idx)
1491 WARN_ON(!mutex_is_locked(&tty_mutex)); 1498 WARN_ON(!mutex_is_locked(&tty_mutex));
1492 if (tty->ops->shutdown) 1499 if (tty->ops->shutdown)
1493 tty->ops->shutdown(tty); 1500 tty->ops->shutdown(tty);
1494 tty_free_termios(tty); 1501 tty_save_termios(tty);
1495 tty_driver_remove_tty(tty->driver, tty); 1502 tty_driver_remove_tty(tty->driver, tty);
1496 tty->port->itty = NULL; 1503 tty->port->itty = NULL;
1497 if (tty->link) 1504 if (tty->link)