diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:53:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:45 -0400 |
commit | 978e595f88a1fba5869aa42a4af4fba36f33ecac (patch) | |
tree | 60848f49949c5b7b518621ee36cdc6d500244539 /drivers/char/epca.c | |
parent | ac0e4b7d319bf284bb64bc7e1c051417386b34a4 (diff) |
tty/serial: lay the foundations for the next set of reworks
- Stop drivers calling their own flush method indirectly, it obfuscates code
and it will change soon anyway
- A few more lock_kernel paths temporarily needed in some driver internal
waiting code
- Remove private put_char method that does a write call for one char - we
have that anyway
- Most but not yet all of the termios copy under lock fixing (some has other
dependencies to follow)
- Note a few locking bugs in drivers found in the process
- Kill remaining [ab]users of TIOCG/SSOFTCAR in the driver, these must go to
fix the termios locking
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/epca.c')
-rw-r--r-- | drivers/char/epca.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/char/epca.c b/drivers/char/epca.c index 37d4dca5a5d..39c6a36e395 100644 --- a/drivers/char/epca.c +++ b/drivers/char/epca.c | |||
@@ -157,7 +157,6 @@ static void epca_error(int, char *); | |||
157 | static void pc_close(struct tty_struct *, struct file *); | 157 | static void pc_close(struct tty_struct *, struct file *); |
158 | static void shutdown(struct channel *); | 158 | static void shutdown(struct channel *); |
159 | static void pc_hangup(struct tty_struct *); | 159 | static void pc_hangup(struct tty_struct *); |
160 | static void pc_put_char(struct tty_struct *, unsigned char); | ||
161 | static int pc_write_room(struct tty_struct *); | 160 | static int pc_write_room(struct tty_struct *); |
162 | static int pc_chars_in_buffer(struct tty_struct *); | 161 | static int pc_chars_in_buffer(struct tty_struct *); |
163 | static void pc_flush_buffer(struct tty_struct *); | 162 | static void pc_flush_buffer(struct tty_struct *); |
@@ -459,8 +458,7 @@ static void pc_close(struct tty_struct *tty, struct file *filp) | |||
459 | setup_empty_event(tty, ch); | 458 | setup_empty_event(tty, ch); |
460 | tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ | 459 | tty_wait_until_sent(tty, 3000); /* 30 seconds timeout */ |
461 | } | 460 | } |
462 | if (tty->driver->flush_buffer) | 461 | pc_flush_buffer(tty); |
463 | tty->driver->flush_buffer(tty); | ||
464 | 462 | ||
465 | tty_ldisc_flush(tty); | 463 | tty_ldisc_flush(tty); |
466 | shutdown(ch); | 464 | shutdown(ch); |
@@ -532,8 +530,7 @@ static void pc_hangup(struct tty_struct *tty) | |||
532 | if ((ch = verifyChannel(tty)) != NULL) { | 530 | if ((ch = verifyChannel(tty)) != NULL) { |
533 | unsigned long flags; | 531 | unsigned long flags; |
534 | 532 | ||
535 | if (tty->driver->flush_buffer) | 533 | pc_flush_buffer(tty); |
536 | tty->driver->flush_buffer(tty); | ||
537 | tty_ldisc_flush(tty); | 534 | tty_ldisc_flush(tty); |
538 | shutdown(ch); | 535 | shutdown(ch); |
539 | 536 | ||
@@ -645,11 +642,6 @@ static int pc_write(struct tty_struct *tty, | |||
645 | return amountCopied; | 642 | return amountCopied; |
646 | } | 643 | } |
647 | 644 | ||
648 | static void pc_put_char(struct tty_struct *tty, unsigned char c) | ||
649 | { | ||
650 | pc_write(tty, &c, 1); | ||
651 | } | ||
652 | |||
653 | static int pc_write_room(struct tty_struct *tty) | 645 | static int pc_write_room(struct tty_struct *tty) |
654 | { | 646 | { |
655 | int remain; | 647 | int remain; |
@@ -1035,7 +1027,6 @@ static const struct tty_operations pc_ops = { | |||
1035 | .flush_buffer = pc_flush_buffer, | 1027 | .flush_buffer = pc_flush_buffer, |
1036 | .chars_in_buffer = pc_chars_in_buffer, | 1028 | .chars_in_buffer = pc_chars_in_buffer, |
1037 | .flush_chars = pc_flush_chars, | 1029 | .flush_chars = pc_flush_chars, |
1038 | .put_char = pc_put_char, | ||
1039 | .ioctl = pc_ioctl, | 1030 | .ioctl = pc_ioctl, |
1040 | .set_termios = pc_set_termios, | 1031 | .set_termios = pc_set_termios, |
1041 | .stop = pc_stop, | 1032 | .stop = pc_stop, |