aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/tty_io.c
diff options
context:
space:
mode:
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)