Commit 76af233d authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

tty: remove unused tty_throttle

The last user was removed in commit e91e52e4 (n_tty: Fix stuck
throttled driver) in 2013. So remove exported tty_throttle completely.
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210510065923.5112-1-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1bf42296
...@@ -96,28 +96,6 @@ void tty_driver_flush_buffer(struct tty_struct *tty) ...@@ -96,28 +96,6 @@ void tty_driver_flush_buffer(struct tty_struct *tty)
} }
EXPORT_SYMBOL(tty_driver_flush_buffer); EXPORT_SYMBOL(tty_driver_flush_buffer);
/**
* tty_throttle - flow control
* @tty: terminal
*
* Indicate that a tty should stop transmitting data down the stack.
* Takes the termios rwsem to protect against parallel throttle/unthrottle
* and also to ensure the driver can consistently reference its own
* termios data at this point when implementing software flow control.
*/
void tty_throttle(struct tty_struct *tty)
{
down_write(&tty->termios_rwsem);
/* check TTY_THROTTLED first so it indicates our state */
if (!test_and_set_bit(TTY_THROTTLED, &tty->flags) &&
tty->ops->throttle)
tty->ops->throttle(tty);
tty->flow_change = 0;
up_write(&tty->termios_rwsem);
}
EXPORT_SYMBOL(tty_throttle);
/** /**
* tty_unthrottle - flow control * tty_unthrottle - flow control
* @tty: terminal * @tty: terminal
...@@ -146,10 +124,11 @@ EXPORT_SYMBOL(tty_unthrottle); ...@@ -146,10 +124,11 @@ EXPORT_SYMBOL(tty_unthrottle);
* tty_throttle_safe - flow control * tty_throttle_safe - flow control
* @tty: terminal * @tty: terminal
* *
* Similar to tty_throttle() but will only attempt throttle * Indicate that a tty should stop transmitting data down the stack.
* if tty->flow_change is TTY_THROTTLE_SAFE. Prevents an accidental * tty_throttle_safe will only attempt throttle if tty->flow_change is
* throttle due to race conditions when throttling is conditional * TTY_THROTTLE_SAFE. Prevents an accidental throttle due to race
* on factors evaluated prior to throttling. * conditions when throttling is conditional on factors evaluated prior to
* throttling.
* *
* Returns 0 if tty is throttled (or was already throttled) * Returns 0 if tty is throttled (or was already throttled)
*/ */
......
...@@ -461,7 +461,6 @@ extern int tty_put_char(struct tty_struct *tty, unsigned char c); ...@@ -461,7 +461,6 @@ extern int tty_put_char(struct tty_struct *tty, unsigned char c);
extern unsigned int tty_chars_in_buffer(struct tty_struct *tty); extern unsigned int tty_chars_in_buffer(struct tty_struct *tty);
extern unsigned int tty_write_room(struct tty_struct *tty); extern unsigned int tty_write_room(struct tty_struct *tty);
extern void tty_driver_flush_buffer(struct tty_struct *tty); extern void tty_driver_flush_buffer(struct tty_struct *tty);
extern void tty_throttle(struct tty_struct *tty);
extern void tty_unthrottle(struct tty_struct *tty); extern void tty_unthrottle(struct tty_struct *tty);
extern int tty_throttle_safe(struct tty_struct *tty); extern int tty_throttle_safe(struct tty_struct *tty);
extern int tty_unthrottle_safe(struct tty_struct *tty); extern int tty_unthrottle_safe(struct tty_struct *tty);
......
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
* the line discipline are close to full, and it should somehow * the line discipline are close to full, and it should somehow
* signal that no more characters should be sent to the tty. * signal that no more characters should be sent to the tty.
* *
* Optional: Always invoke via tty_throttle(), called under the * Optional: Always invoke via tty_throttle_safe(), called under the
* termios lock. * termios lock.
* *
* void (*unthrottle)(struct tty_struct * tty); * void (*unthrottle)(struct tty_struct * tty);
......
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