diff options
author | Jiri Slaby <jslaby@suse.cz> | 2012-04-02 07:53:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-04-09 14:16:54 -0400 |
commit | ce93d33cf45db9893cfc725a2b470da15bfe4435 (patch) | |
tree | 364b1ff9f6beead5f94746d674ed03a93ecc0184 /drivers/isdn | |
parent | 6776a2f07924192fd168bdceb1a00d10630edb4d (diff) |
TTY: isdn, do not play with module refcounts
The module which called allocate_tty_driver is already refcounted by
the TTY layer automatically. And since THIS_MODULE is isdn_tty and it
allocated the tty_driver, there is no need to do the counts in isdn's
tty->ops->open/close.
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_tty.c | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index bcf4bbe693bc..1ff307276d2d 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -1584,10 +1584,6 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) | |||
1584 | info = &dev->mdm.info[tty->index]; | 1584 | info = &dev->mdm.info[tty->index]; |
1585 | if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open")) | 1585 | if (isdn_tty_paranoia_check(info, tty->name, "isdn_tty_open")) |
1586 | return -ENODEV; | 1586 | return -ENODEV; |
1587 | if (!try_module_get(info->owner)) { | ||
1588 | printk(KERN_WARNING "%s: cannot reserve module\n", __func__); | ||
1589 | return -ENODEV; | ||
1590 | } | ||
1591 | #ifdef ISDN_DEBUG_MODEM_OPEN | 1587 | #ifdef ISDN_DEBUG_MODEM_OPEN |
1592 | printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name, | 1588 | printk(KERN_DEBUG "isdn_tty_open %s, count = %d\n", tty->name, |
1593 | info->count); | 1589 | info->count); |
@@ -1603,7 +1599,6 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) | |||
1603 | #ifdef ISDN_DEBUG_MODEM_OPEN | 1599 | #ifdef ISDN_DEBUG_MODEM_OPEN |
1604 | printk(KERN_DEBUG "isdn_tty_open return after startup\n"); | 1600 | printk(KERN_DEBUG "isdn_tty_open return after startup\n"); |
1605 | #endif | 1601 | #endif |
1606 | module_put(info->owner); | ||
1607 | return retval; | 1602 | return retval; |
1608 | } | 1603 | } |
1609 | retval = isdn_tty_block_til_ready(tty, filp, info); | 1604 | retval = isdn_tty_block_til_ready(tty, filp, info); |
@@ -1611,7 +1606,6 @@ isdn_tty_open(struct tty_struct *tty, struct file *filp) | |||
1611 | #ifdef ISDN_DEBUG_MODEM_OPEN | 1606 | #ifdef ISDN_DEBUG_MODEM_OPEN |
1612 | printk(KERN_DEBUG "isdn_tty_open return after isdn_tty_block_til_ready \n"); | 1607 | printk(KERN_DEBUG "isdn_tty_open return after isdn_tty_block_til_ready \n"); |
1613 | #endif | 1608 | #endif |
1614 | module_put(info->owner); | ||
1615 | return retval; | 1609 | return retval; |
1616 | } | 1610 | } |
1617 | #ifdef ISDN_DEBUG_MODEM_OPEN | 1611 | #ifdef ISDN_DEBUG_MODEM_OPEN |
@@ -1659,7 +1653,6 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) | |||
1659 | #ifdef ISDN_DEBUG_MODEM_OPEN | 1653 | #ifdef ISDN_DEBUG_MODEM_OPEN |
1660 | printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n"); | 1654 | printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n"); |
1661 | #endif | 1655 | #endif |
1662 | module_put(info->owner); | ||
1663 | return; | 1656 | return; |
1664 | } | 1657 | } |
1665 | info->flags |= ASYNC_CLOSING; | 1658 | info->flags |= ASYNC_CLOSING; |
@@ -1692,7 +1685,6 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) | |||
1692 | info->tty = NULL; | 1685 | info->tty = NULL; |
1693 | info->ncarrier = 0; | 1686 | info->ncarrier = 0; |
1694 | tty->closing = 0; | 1687 | tty->closing = 0; |
1695 | module_put(info->owner); | ||
1696 | if (info->blocked_open) { | 1688 | if (info->blocked_open) { |
1697 | msleep_interruptible(500); | 1689 | msleep_interruptible(500); |
1698 | wake_up_interruptible(&info->open_wait); | 1690 | wake_up_interruptible(&info->open_wait); |
@@ -1880,9 +1872,6 @@ isdn_tty_modem_init(void) | |||
1880 | goto err_unregister; | 1872 | goto err_unregister; |
1881 | } | 1873 | } |
1882 | #endif | 1874 | #endif |
1883 | #ifdef MODULE | ||
1884 | info->owner = THIS_MODULE; | ||
1885 | #endif | ||
1886 | spin_lock_init(&info->readlock); | 1875 | spin_lock_init(&info->readlock); |
1887 | sprintf(info->last_cause, "0000"); | 1876 | sprintf(info->last_cause, "0000"); |
1888 | sprintf(info->last_num, "none"); | 1877 | sprintf(info->last_num, "none"); |