aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/nozomi.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2011-04-20 04:43:13 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-25 17:19:10 -0400
commit6d742f655efe767dc77a099b57297fa417afc473 (patch)
treeddfad773d1a748fa860572364b7cd361d8429041 /drivers/tty/nozomi.c
parentc29bd8d89c9423aed182dbfdb6527b576a2f3552 (diff)
Char: nozomi, remove port.count checks
Before 33dd474a, these were some kind of protection against race with HUP. They were protected with port->tty_sem at the same time. By that commit, the counting was switched to tty_port's one, but the locking remained the old one. So the count was not protected by any lock anymore. The driver should not test whether it raced with HUP or not anyways. With the new refcounted tty model, it just should proceed as nothing happened because all needed info is still there. In respect to this, let's drop the useless and unprotected tests (tty_port->count is protected by tty_port->lock). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Tested-by: Gerald Pfeifer <gerald@pfeifer.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty/nozomi.c')
-rw-r--r--drivers/tty/nozomi.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index acaecc173881..c34d622dace4 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -1690,11 +1690,6 @@ static int ntty_write(struct tty_struct *tty, const unsigned char *buffer,
1690 1690
1691 mutex_lock(&port->tty_sem); 1691 mutex_lock(&port->tty_sem);
1692 1692
1693 if (unlikely(!port->port.count)) {
1694 DBG1(" ");
1695 goto exit;
1696 }
1697
1698 rval = kfifo_in(&port->fifo_ul, (unsigned char *)buffer, count); 1693 rval = kfifo_in(&port->fifo_ul, (unsigned char *)buffer, count);
1699 1694
1700 /* notify card */ 1695 /* notify card */
@@ -1740,8 +1735,7 @@ static int ntty_write_room(struct tty_struct *tty)
1740 1735
1741 if (dc) { 1736 if (dc) {
1742 mutex_lock(&port->tty_sem); 1737 mutex_lock(&port->tty_sem);
1743 if (port->port.count) 1738 room = kfifo_avail(&port->fifo_ul);
1744 room = kfifo_avail(&port->fifo_ul);
1745 mutex_unlock(&port->tty_sem); 1739 mutex_unlock(&port->tty_sem);
1746 } 1740 }
1747 return room; 1741 return room;
@@ -1889,11 +1883,6 @@ static s32 ntty_chars_in_buffer(struct tty_struct *tty)
1889 goto exit_in_buffer; 1883 goto exit_in_buffer;
1890 } 1884 }
1891 1885
1892 if (unlikely(!port->port.count)) {
1893 dev_err(&dc->pdev->dev, "No tty open?\n");
1894 goto exit_in_buffer;
1895 }
1896
1897 rval = kfifo_len(&port->fifo_ul); 1886 rval = kfifo_len(&port->fifo_ul);
1898 1887
1899exit_in_buffer: 1888exit_in_buffer: