diff options
Diffstat (limited to 'drivers/char/specialix.c')
-rw-r--r-- | drivers/char/specialix.c | 46 |
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 | ||
1507 | static 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 | ||
1508 | static void sx_close(struct tty_struct * tty, struct file * filp) | 1529 | static 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 | ||
1773 | static 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 | ||
1796 | static int sx_tiocmget(struct tty_struct *tty, struct file *file) | 1794 | static int sx_tiocmget(struct tty_struct *tty, struct file *file) |
1797 | { | 1795 | { |