Skip to content

Commit

Permalink
goldfish: move to tty_port for flip buffers
Browse files Browse the repository at this point in the history
Sorry forgot to merge this in the original submission. Resync
with the tty tree changes moving the buffers into the tty_port

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed Jan 25, 2013
1 parent eb51d91 commit ebcf098
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions drivers/tty/goldfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,18 @@ static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)
unsigned long irq_flags;
unsigned char *buf;
u32 count;
struct tty_struct *tty;

count = readl(base + GOLDFISH_TTY_BYTES_READY);
if(count == 0)
return IRQ_NONE;

tty = tty_port_tty_get(&qtty->port);
if (tty) {
count = tty_prepare_flip_string(tty, &buf, count);
spin_lock_irqsave(&qtty->lock, irq_flags);
writel((u32)buf, base + GOLDFISH_TTY_DATA_PTR);
writel(count, base + GOLDFISH_TTY_DATA_LEN);
writel(GOLDFISH_TTY_CMD_READ_BUFFER, base + GOLDFISH_TTY_CMD);
spin_unlock_irqrestore(&qtty->lock, irq_flags);
tty_schedule_flip(tty);
tty_kref_put(tty);
}
count = tty_prepare_flip_string(&qtty->port, &buf, count);
spin_lock_irqsave(&qtty->lock, irq_flags);
writel((u32)buf, base + GOLDFISH_TTY_DATA_PTR);
writel(count, base + GOLDFISH_TTY_DATA_LEN);
writel(GOLDFISH_TTY_CMD_READ_BUFFER, base + GOLDFISH_TTY_CMD);
spin_unlock_irqrestore(&qtty->lock, irq_flags);
tty_schedule_flip(&qtty->port);
return IRQ_HANDLED;
}

Expand Down

0 comments on commit ebcf098

Please sign in to comment.