Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354934
b: refs/heads/master
c: 7e5730d
h: refs/heads/master
v: v3
  • Loading branch information
Samuel Iglesias Gonsalvez authored and Greg Kroah-Hartman committed Jan 16, 2013
1 parent f690662 commit 799cfe3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69a6b9b1b6aec645d2efa23db2c15ed287e672dd
refs/heads/master: 7e5730d7c22267e406454b5cff0c40e4ebf9a0da
21 changes: 2 additions & 19 deletions trunk/drivers/ipack/devices/ipoctal.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ struct ipoctal_channel {
spinlock_t lock;
unsigned int pointer_read;
unsigned int pointer_write;
atomic_t open;
struct tty_port tty_port;
union scc2698_channel __iomem *regs;
union scc2698_block __iomem *block_regs;
Expand Down Expand Up @@ -70,22 +69,12 @@ static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty)

static int ipoctal_open(struct tty_struct *tty, struct file *file)
{
int res;
struct ipoctal_channel *channel;

channel = dev_get_drvdata(tty->dev);

if (atomic_read(&channel->open))
return -EBUSY;

tty->driver_data = channel;

res = tty_port_open(&channel->tty_port, tty, file);
if (res)
return res;

atomic_inc(&channel->open);
return 0;
return tty_port_open(&channel->tty_port, tty, file);
}

static void ipoctal_reset_stats(struct ipoctal_stats *stats)
Expand All @@ -111,9 +100,7 @@ static void ipoctal_close(struct tty_struct *tty, struct file *filp)
struct ipoctal_channel *channel = tty->driver_data;

tty_port_close(&channel->tty_port, tty, filp);

if (atomic_dec_and_test(&channel->open))
ipoctal_free_channel(channel);
ipoctal_free_channel(channel);
}

static int ipoctal_get_icount(struct tty_struct *tty,
Expand Down Expand Up @@ -205,10 +192,6 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
u8 isr, sr;
struct tty_struct *tty;

/* If there is no client, skip the check */
if (!atomic_read(&channel->open))
return;

tty = tty_port_tty_get(&channel->tty_port);
if (!tty)
return;
Expand Down

0 comments on commit 799cfe3

Please sign in to comment.