aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2012-04-02 07:53:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-09 14:16:55 -0400
commitc6e92b63d711c12ffb47f4dbb53902b7f26032e7 (patch)
treebc104c268a5ee048b468104c023ec483ffde5638 /drivers/isdn
parent48decc1c743fa4eb5ba5dd3f556e7fcbefe65440 (diff)
TTY: isdn, use open/close_wait from tty_port
Hmm, the isdn ones were initialized twice. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/i4l/isdn_common.c2
-rw-r--r--drivers/isdn/i4l/isdn_tty.c16
2 files changed, 7 insertions, 11 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index d9f5524593fb..2ffa0b733327 100644
--- a/drivers/isdn/i4l/isdn_common.c
+++ b/drivers/isdn/i4l/isdn_common.c
@@ -2327,8 +2327,6 @@ static int __init isdn_init(void)
2327 dev->chanmap[i] = -1; 2327 dev->chanmap[i] = -1;
2328 dev->m_idx[i] = -1; 2328 dev->m_idx[i] = -1;
2329 strcpy(dev->num[i], "???"); 2329 strcpy(dev->num[i], "???");
2330 init_waitqueue_head(&dev->mdm.info[i].open_wait);
2331 init_waitqueue_head(&dev->mdm.info[i].close_wait);
2332 } 2330 }
2333 if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) { 2331 if (register_chrdev(ISDN_MAJOR, "isdn", &isdn_fops)) {
2334 printk(KERN_WARNING "isdn: Could not register control devices\n"); 2332 printk(KERN_WARNING "isdn: Could not register control devices\n");
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 8ba526dc98bc..33764d052e19 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -1498,7 +1498,7 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info *
1498 if (tty_hung_up_p(filp) || 1498 if (tty_hung_up_p(filp) ||
1499 (info->port.flags & ASYNC_CLOSING)) { 1499 (info->port.flags & ASYNC_CLOSING)) {
1500 if (info->port.flags & ASYNC_CLOSING) 1500 if (info->port.flags & ASYNC_CLOSING)
1501 interruptible_sleep_on(&info->close_wait); 1501 interruptible_sleep_on(&info->port.close_wait);
1502#ifdef MODEM_DO_RESTART 1502#ifdef MODEM_DO_RESTART
1503 if (info->port.flags & ASYNC_HUP_NOTIFY) 1503 if (info->port.flags & ASYNC_HUP_NOTIFY)
1504 return -EAGAIN; 1504 return -EAGAIN;
@@ -1527,7 +1527,7 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info *
1527 * exit, either normal or abnormal. 1527 * exit, either normal or abnormal.
1528 */ 1528 */
1529 retval = 0; 1529 retval = 0;
1530 add_wait_queue(&info->open_wait, &wait); 1530 add_wait_queue(&info->port.open_wait, &wait);
1531#ifdef ISDN_DEBUG_MODEM_OPEN 1531#ifdef ISDN_DEBUG_MODEM_OPEN
1532 printk(KERN_DEBUG "isdn_tty_block_til_ready before block: ttyi%d, count = %d\n", 1532 printk(KERN_DEBUG "isdn_tty_block_til_ready before block: ttyi%d, count = %d\n",
1533 info->line, info->count); 1533 info->line, info->count);
@@ -1564,7 +1564,7 @@ isdn_tty_block_til_ready(struct tty_struct *tty, struct file *filp, modem_info *
1564 schedule(); 1564 schedule();
1565 } 1565 }
1566 current->state = TASK_RUNNING; 1566 current->state = TASK_RUNNING;
1567 remove_wait_queue(&info->open_wait, &wait); 1567 remove_wait_queue(&info->port.open_wait, &wait);
1568 if (!tty_hung_up_p(filp)) 1568 if (!tty_hung_up_p(filp))
1569 info->count++; 1569 info->count++;
1570 info->blocked_open--; 1570 info->blocked_open--;
@@ -1697,10 +1697,10 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp)
1697 tty->closing = 0; 1697 tty->closing = 0;
1698 if (info->blocked_open) { 1698 if (info->blocked_open) {
1699 msleep_interruptible(500); 1699 msleep_interruptible(500);
1700 wake_up_interruptible(&info->open_wait); 1700 wake_up_interruptible(&info->port.open_wait);
1701 } 1701 }
1702 info->port.flags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_CLOSING); 1702 info->port.flags &= ~(ASYNC_NORMAL_ACTIVE | ASYNC_CLOSING);
1703 wake_up_interruptible(&info->close_wait); 1703 wake_up_interruptible(&info->port.close_wait);
1704#ifdef ISDN_DEBUG_MODEM_OPEN 1704#ifdef ISDN_DEBUG_MODEM_OPEN
1705 printk(KERN_DEBUG "isdn_tty_close normal exit\n"); 1705 printk(KERN_DEBUG "isdn_tty_close normal exit\n");
1706#endif 1706#endif
@@ -1720,7 +1720,7 @@ isdn_tty_hangup(struct tty_struct *tty)
1720 info->count = 0; 1720 info->count = 0;
1721 info->port.flags &= ~ASYNC_NORMAL_ACTIVE; 1721 info->port.flags &= ~ASYNC_NORMAL_ACTIVE;
1722 info->tty = NULL; 1722 info->tty = NULL;
1723 wake_up_interruptible(&info->open_wait); 1723 wake_up_interruptible(&info->port.open_wait);
1724} 1724}
1725 1725
1726/* This routine initializes all emulator-data. 1726/* This routine initializes all emulator-data.
@@ -1898,8 +1898,6 @@ isdn_tty_modem_init(void)
1898 info->x_char = 0; 1898 info->x_char = 0;
1899 info->count = 0; 1899 info->count = 0;
1900 info->blocked_open = 0; 1900 info->blocked_open = 0;
1901 init_waitqueue_head(&info->open_wait);
1902 init_waitqueue_head(&info->close_wait);
1903 info->isdn_driver = -1; 1901 info->isdn_driver = -1;
1904 info->isdn_channel = -1; 1902 info->isdn_channel = -1;
1905 info->drv_index = -1; 1903 info->drv_index = -1;
@@ -2194,7 +2192,7 @@ isdn_tty_stat_callback(int i, isdn_ctrl *c)
2194 */ 2192 */
2195 if (info->blocked_open && 2193 if (info->blocked_open &&
2196 (info->emu.mdmreg[REG_DCD] & BIT_DCD)) { 2194 (info->emu.mdmreg[REG_DCD] & BIT_DCD)) {
2197 wake_up_interruptible(&info->open_wait); 2195 wake_up_interruptible(&info->port.open_wait);
2198 } 2196 }
2199 2197
2200 /* Schedule CONNECT-Message to any tty 2198 /* Schedule CONNECT-Message to any tty