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/pty.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/pty.c')
-rw-r--r-- | drivers/char/pty.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 0a05c038ae6f..76b27932d229 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -111,7 +111,7 @@ static int pty_write(struct tty_struct * tty, const unsigned char *buf, int coun | |||
111 | c = to->receive_room; | 111 | c = to->receive_room; |
112 | if (c > count) | 112 | if (c > count) |
113 | c = count; | 113 | c = count; |
114 | to->ldisc.receive_buf(to, buf, NULL, c); | 114 | to->ldisc.ops->receive_buf(to, buf, NULL, c); |
115 | 115 | ||
116 | return c; | 116 | return c; |
117 | } | 117 | } |
@@ -149,11 +149,11 @@ static int pty_chars_in_buffer(struct tty_struct *tty) | |||
149 | int count; | 149 | int count; |
150 | 150 | ||
151 | /* We should get the line discipline lock for "tty->link" */ | 151 | /* We should get the line discipline lock for "tty->link" */ |
152 | if (!to || !to->ldisc.chars_in_buffer) | 152 | if (!to || !to->ldisc.ops->chars_in_buffer) |
153 | return 0; | 153 | return 0; |
154 | 154 | ||
155 | /* The ldisc must report 0 if no characters available to be read */ | 155 | /* The ldisc must report 0 if no characters available to be read */ |
156 | count = to->ldisc.chars_in_buffer(to); | 156 | count = to->ldisc.ops->chars_in_buffer(to); |
157 | 157 | ||
158 | if (tty->driver->subtype == PTY_TYPE_SLAVE) return count; | 158 | if (tty->driver->subtype == PTY_TYPE_SLAVE) return count; |
159 | 159 | ||
@@ -186,8 +186,8 @@ static void pty_flush_buffer(struct tty_struct *tty) | |||
186 | if (!to) | 186 | if (!to) |
187 | return; | 187 | return; |
188 | 188 | ||
189 | if (to->ldisc.flush_buffer) | 189 | if (to->ldisc.ops->flush_buffer) |
190 | to->ldisc.flush_buffer(to); | 190 | to->ldisc.ops->flush_buffer(to); |
191 | 191 | ||
192 | if (to->packet) { | 192 | if (to->packet) { |
193 | spin_lock_irqsave(&tty->ctrl_lock, flags); | 193 | spin_lock_irqsave(&tty->ctrl_lock, flags); |