diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2009-09-19 16:13:13 -0400 |
---|---|---|
committer | Live-CD User <linux@linux.site> | 2009-09-19 16:13:13 -0400 |
commit | 174e6fe01e7881caaa350b5e98e4c6189b6cb593 (patch) | |
tree | 23748eaa318e8c7e224e10a566673bf8312963c0 /drivers/char/cyclades.c | |
parent | f0eefdc30e55e761facf645bd1be1339b21c30e6 (diff) |
cyclades: switch to tty_port_hangup
Do not duplicate common tty_port_hangup code. Use it instead.
Also do not unset ASYNC_NORMAL_ACTIVE and wake up from the
tty_hangup() caller. It makes no sense since we don't check that
flag in sleepers. tty_port_hangup() performed later will do the
right job.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/char/cyclades.c')
-rw-r--r-- | drivers/char/cyclades.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index 7a7092ae5d39..226175d605c3 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -1290,11 +1290,10 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip, | |||
1290 | } | 1290 | } |
1291 | 1291 | ||
1292 | if ((mdm_change & CyDCD) && (info->port.flags & ASYNC_CHECK_CD)) { | 1292 | if ((mdm_change & CyDCD) && (info->port.flags & ASYNC_CHECK_CD)) { |
1293 | if (!(mdm_status & CyDCD)) { | 1293 | if (mdm_status & CyDCD) |
1294 | wake_up_interruptible(&info->port.open_wait); | ||
1295 | else | ||
1294 | tty_hangup(tty); | 1296 | tty_hangup(tty); |
1295 | info->port.flags &= ~ASYNC_NORMAL_ACTIVE; | ||
1296 | } | ||
1297 | wake_up_interruptible(&info->port.open_wait); | ||
1298 | } | 1297 | } |
1299 | if ((mdm_change & CyCTS) && (info->port.flags & ASYNC_CTS_FLOW)) { | 1298 | if ((mdm_change & CyCTS) && (info->port.flags & ASYNC_CTS_FLOW)) { |
1300 | if (tty->hw_stopped) { | 1299 | if (tty->hw_stopped) { |
@@ -1655,13 +1654,10 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo) | |||
1655 | if (info->port.flags & ASYNC_CHECK_CD) { | 1654 | if (info->port.flags & ASYNC_CHECK_CD) { |
1656 | u32 dcd = fw_ver > 241 ? param : | 1655 | u32 dcd = fw_ver > 241 ? param : |
1657 | readl(&info->u.cyz.ch_ctrl->rs_status); | 1656 | readl(&info->u.cyz.ch_ctrl->rs_status); |
1658 | if (dcd & C_RS_DCD) { | 1657 | if (dcd & C_RS_DCD) |
1659 | wake_up_interruptible(&info->port.open_wait); | 1658 | wake_up_interruptible(&info->port.open_wait); |
1660 | } else { | 1659 | else |
1661 | tty_hangup(tty); | 1660 | tty_hangup(tty); |
1662 | wake_up_interruptible(&info->port.open_wait); | ||
1663 | info->port.flags &= ~ASYNC_NORMAL_ACTIVE; | ||
1664 | } | ||
1665 | } | 1661 | } |
1666 | break; | 1662 | break; |
1667 | case C_CM_MCTS: | 1663 | case C_CM_MCTS: |
@@ -4009,14 +4005,7 @@ static void cy_hangup(struct tty_struct *tty) | |||
4009 | 4005 | ||
4010 | cy_flush_buffer(tty); | 4006 | cy_flush_buffer(tty); |
4011 | cy_shutdown(info, tty); | 4007 | cy_shutdown(info, tty); |
4012 | info->port.count = 0; | 4008 | tty_port_hangup(&info->port); |
4013 | #ifdef CY_DEBUG_COUNT | ||
4014 | printk(KERN_DEBUG "cyc:cy_hangup (%d): setting count to 0\n", | ||
4015 | current->pid); | ||
4016 | #endif | ||
4017 | tty_port_tty_set(&info->port, NULL); | ||
4018 | info->port.flags &= ~ASYNC_NORMAL_ACTIVE; | ||
4019 | wake_up_interruptible(&info->port.open_wait); | ||
4020 | } /* cy_hangup */ | 4009 | } /* cy_hangup */ |
4021 | 4010 | ||
4022 | static int cyy_carrier_raised(struct tty_port *port) | 4011 | static int cyy_carrier_raised(struct tty_port *port) |