Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 304157
b: refs/heads/master
c: d73a4e7
h: refs/heads/master
i:
  304155: 45698f4
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Apr 9, 2012
1 parent 420ee4f commit 5ea0fc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 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: 5f566051fbc3e7754f903b3b4bf67a44e0ae2d1a
refs/heads/master: d73a4e790d05151dadf8c6de84382411a8f073fd
13 changes: 7 additions & 6 deletions trunk/drivers/tty/hvc/hvsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
#define __ALIGNED__ __attribute__((__aligned__(sizeof(long))))

struct hvsi_struct {
struct tty_port port;
struct delayed_work writer;
struct work_struct handshaker;
wait_queue_head_t emptyq; /* woken when outbuf is emptied */
wait_queue_head_t stateq; /* woken when HVSI state changes */
spinlock_t lock;
int index;
struct tty_struct *tty;
int count;
uint8_t throttle_buf[128];
uint8_t outbuf[N_OUTBUF]; /* to implement write_room and chars_in_buffer */
/* inbuf is for packet reassembly. leave a little room for leftovers. */
Expand Down Expand Up @@ -751,7 +751,7 @@ static int hvsi_open(struct tty_struct *tty, struct file *filp)

spin_lock_irqsave(&hp->lock, flags);
hp->tty = tty;
hp->count++;
hp->port.count++;
atomic_set(&hp->seqno, 0);
h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE);
spin_unlock_irqrestore(&hp->lock, flags);
Expand Down Expand Up @@ -808,7 +808,7 @@ static void hvsi_close(struct tty_struct *tty, struct file *filp)

spin_lock_irqsave(&hp->lock, flags);

if (--hp->count == 0) {
if (--hp->port.count == 0) {
hp->tty = NULL;
hp->inbuf_end = hp->inbuf; /* discard remaining partial packets */

Expand Down Expand Up @@ -841,9 +841,9 @@ static void hvsi_close(struct tty_struct *tty, struct file *filp)

spin_lock_irqsave(&hp->lock, flags);
}
} else if (hp->count < 0)
} else if (hp->port.count < 0)
printk(KERN_ERR "hvsi_close %lu: oops, count is %d\n",
hp - hvsi_ports, hp->count);
hp - hvsi_ports, hp->port.count);

spin_unlock_irqrestore(&hp->lock, flags);
}
Expand All @@ -857,7 +857,7 @@ static void hvsi_hangup(struct tty_struct *tty)

spin_lock_irqsave(&hp->lock, flags);

hp->count = 0;
hp->port.count = 0;
hp->n_outbuf = 0;
hp->tty = NULL;

Expand Down Expand Up @@ -1228,6 +1228,7 @@ static int __init hvsi_console_init(void)
init_waitqueue_head(&hp->emptyq);
init_waitqueue_head(&hp->stateq);
spin_lock_init(&hp->lock);
tty_port_init(&hp->port);
hp->index = hvsi_count;
hp->inbuf_end = hp->inbuf;
hp->state = HVSI_CLOSED;
Expand Down

0 comments on commit 5ea0fc7

Please sign in to comment.