diff options
author | Alan Cox <alan@redhat.com> | 2008-07-16 16:53:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-20 20:12:34 -0400 |
commit | a352def21a642133758b868c71bee12ab34ad5c5 (patch) | |
tree | 95d0f7229f9e4afccdc6fbbf11f7f5c6dd83b0fd /drivers/char/tty_ioctl.c | |
parent | e1e5770bb63fb9d71619a68f52cb0ba4b2ae58a6 (diff) |
tty: Ldisc revamp
Move the line disciplines towards a conventional ->ops arrangement. For
the moment the actual 'tty_ldisc' struct in the tty is kept as part of
the tty struct but this can then be changed if it turns out that when it
all settles down we want to refcount ldiscs separately to the tty.
Pull the ldisc code out of /proc and put it with our ldisc code.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/tty_ioctl.c')
-rw-r--r-- | drivers/char/tty_ioctl.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/char/tty_ioctl.c b/drivers/char/tty_ioctl.c index 8f81139d6194..ea9fc5d03b99 100644 --- a/drivers/char/tty_ioctl.c +++ b/drivers/char/tty_ioctl.c | |||
@@ -491,8 +491,8 @@ static void change_termios(struct tty_struct *tty, struct ktermios *new_termios) | |||
491 | 491 | ||
492 | ld = tty_ldisc_ref(tty); | 492 | ld = tty_ldisc_ref(tty); |
493 | if (ld != NULL) { | 493 | if (ld != NULL) { |
494 | if (ld->set_termios) | 494 | if (ld->ops->set_termios) |
495 | (ld->set_termios)(tty, &old_termios); | 495 | (ld->ops->set_termios)(tty, &old_termios); |
496 | tty_ldisc_deref(ld); | 496 | tty_ldisc_deref(ld); |
497 | } | 497 | } |
498 | mutex_unlock(&tty->termios_mutex); | 498 | mutex_unlock(&tty->termios_mutex); |
@@ -552,8 +552,8 @@ static int set_termios(struct tty_struct *tty, void __user *arg, int opt) | |||
552 | ld = tty_ldisc_ref(tty); | 552 | ld = tty_ldisc_ref(tty); |
553 | 553 | ||
554 | if (ld != NULL) { | 554 | if (ld != NULL) { |
555 | if ((opt & TERMIOS_FLUSH) && ld->flush_buffer) | 555 | if ((opt & TERMIOS_FLUSH) && ld->ops->flush_buffer) |
556 | ld->flush_buffer(tty); | 556 | ld->ops->flush_buffer(tty); |
557 | tty_ldisc_deref(ld); | 557 | tty_ldisc_deref(ld); |
558 | } | 558 | } |
559 | 559 | ||
@@ -959,12 +959,12 @@ int tty_perform_flush(struct tty_struct *tty, unsigned long arg) | |||
959 | ld = tty_ldisc_ref(tty); | 959 | ld = tty_ldisc_ref(tty); |
960 | switch (arg) { | 960 | switch (arg) { |
961 | case TCIFLUSH: | 961 | case TCIFLUSH: |
962 | if (ld && ld->flush_buffer) | 962 | if (ld && ld->ops->flush_buffer) |
963 | ld->flush_buffer(tty); | 963 | ld->ops->flush_buffer(tty); |
964 | break; | 964 | break; |
965 | case TCIOFLUSH: | 965 | case TCIOFLUSH: |
966 | if (ld && ld->flush_buffer) | 966 | if (ld && ld->ops->flush_buffer) |
967 | ld->flush_buffer(tty); | 967 | ld->ops->flush_buffer(tty); |
968 | /* fall through */ | 968 | /* fall through */ |
969 | case TCOFLUSH: | 969 | case TCOFLUSH: |
970 | tty_driver_flush_buffer(tty); | 970 | tty_driver_flush_buffer(tty); |