Skip to content

Commit

Permalink
riscom/rocket: switch to int put_char method
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Apr 30, 2008
1 parent d7e752e commit bbbbb96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions drivers/char/riscom8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1161,16 +1161,17 @@ static int rc_write(struct tty_struct * tty,
return total;
}

static void rc_put_char(struct tty_struct * tty, unsigned char ch)
static int rc_put_char(struct tty_struct * tty, unsigned char ch)
{
struct riscom_port *port = (struct riscom_port *)tty->driver_data;
unsigned long flags;
int ret = 0;

if (rc_paranoia_check(port, tty->name, "rc_put_char"))
return;
return 0;

if (!tty || !port->xmit_buf)
return;
return 0;

spin_lock_irqsave(&riscom_lock, flags);

Expand All @@ -1180,9 +1181,11 @@ static void rc_put_char(struct tty_struct * tty, unsigned char ch)
port->xmit_buf[port->xmit_head++] = ch;
port->xmit_head &= SERIAL_XMIT_SIZE - 1;
port->xmit_cnt++;
ret = 1;

out:
spin_unlock_irqrestore(&riscom_lock, flags);
return ret;
}

static void rc_flush_chars(struct tty_struct * tty)
Expand Down
5 changes: 3 additions & 2 deletions drivers/char/rocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1663,14 +1663,14 @@ static void rp_hangup(struct tty_struct *tty)
* writing routines will write directly to transmit FIFO.
* Write buffer and counters protected by spinlocks
*/
static void rp_put_char(struct tty_struct *tty, unsigned char ch)
static int rp_put_char(struct tty_struct *tty, unsigned char ch)
{
struct r_port *info = (struct r_port *) tty->driver_data;
CHANNEL_t *cp;
unsigned long flags;

if (rocket_paranoia_check(info, "rp_put_char"))
return;
return 0;

/*
* Grab the port write mutex, locking out other processes that try to
Expand Down Expand Up @@ -1699,6 +1699,7 @@ static void rp_put_char(struct tty_struct *tty, unsigned char ch)
}
spin_unlock_irqrestore(&info->slock, flags);
mutex_unlock(&info->write_mtx);
return 1;
}

/*
Expand Down

0 comments on commit bbbbb96

Please sign in to comment.