aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/specialix.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:53:59 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:45 -0400
commit978e595f88a1fba5869aa42a4af4fba36f33ecac (patch)
tree60848f49949c5b7b518621ee36cdc6d500244539 /drivers/char/specialix.c
parentac0e4b7d319bf284bb64bc7e1c051417386b34a4 (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/specialix.c')
-rw-r--r--drivers/char/specialix.c46
1 files changed, 22 insertions, 24 deletions
diff --git a/drivers/char/specialix.c b/drivers/char/specialix.c
index 9f9a4bdc1b0e..075ad924dd04 100644
--- a/drivers/char/specialix.c
+++ b/drivers/char/specialix.c
@@ -1504,6 +1504,27 @@ static int sx_open(struct tty_struct * tty, struct file * filp)
1504 return 0; 1504 return 0;
1505} 1505}
1506 1506
1507static void sx_flush_buffer(struct tty_struct *tty)
1508{
1509 struct specialix_port *port = (struct specialix_port *)tty->driver_data;
1510 unsigned long flags;
1511 struct specialix_board * bp;
1512
1513 func_enter();
1514
1515 if (sx_paranoia_check(port, tty->name, "sx_flush_buffer")) {
1516 func_exit();
1517 return;
1518 }
1519
1520 bp = port_Board(port);
1521 spin_lock_irqsave(&port->lock, flags);
1522 port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
1523 spin_unlock_irqrestore(&port->lock, flags);
1524 tty_wakeup(tty);
1525
1526 func_exit();
1527}
1507 1528
1508static void sx_close(struct tty_struct * tty, struct file * filp) 1529static void sx_close(struct tty_struct * tty, struct file * filp)
1509{ 1530{
@@ -1597,8 +1618,7 @@ static void sx_close(struct tty_struct * tty, struct file * filp)
1597 } 1618 }
1598 1619
1599 sx_shutdown_port(bp, port); 1620 sx_shutdown_port(bp, port);
1600 if (tty->driver->flush_buffer) 1621 sx_flush_buffer(tty);
1601 tty->driver->flush_buffer(tty);
1602 tty_ldisc_flush(tty); 1622 tty_ldisc_flush(tty);
1603 spin_lock_irqsave(&port->lock, flags); 1623 spin_lock_irqsave(&port->lock, flags);
1604 tty->closing = 0; 1624 tty->closing = 0;
@@ -1770,28 +1790,6 @@ static int sx_chars_in_buffer(struct tty_struct *tty)
1770} 1790}
1771 1791
1772 1792
1773static void sx_flush_buffer(struct tty_struct *tty)
1774{
1775 struct specialix_port *port = (struct specialix_port *)tty->driver_data;
1776 unsigned long flags;
1777 struct specialix_board * bp;
1778
1779 func_enter();
1780
1781 if (sx_paranoia_check(port, tty->name, "sx_flush_buffer")) {
1782 func_exit();
1783 return;
1784 }
1785
1786 bp = port_Board(port);
1787 spin_lock_irqsave(&port->lock, flags);
1788 port->xmit_cnt = port->xmit_head = port->xmit_tail = 0;
1789 spin_unlock_irqrestore(&port->lock, flags);
1790 tty_wakeup(tty);
1791
1792 func_exit();
1793}
1794
1795 1793
1796static int sx_tiocmget(struct tty_struct *tty, struct file *file) 1794static int sx_tiocmget(struct tty_struct *tty, struct file *file)
1797{ 1795{