aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2008-04-30 03:54:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 11:29:47 -0400
commit23d22cea85ba9114a59a32ca8dfb1e2aef52a278 (patch)
tree300a122ecc3583454058de7c2a7c01a7a2322cef /drivers/serial
parent56dbbb9a5704f665068778d4d2c1bdf757756e60 (diff)
serial: switch the serial core to int put_char methods
Signed-off-by: Alan Cox <alan@redhat.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/serial_core.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c
index f7263e104d81..6c7a5cf76582 100644
--- a/drivers/serial/serial_core.c
+++ b/drivers/serial/serial_core.c
@@ -422,6 +422,7 @@ uart_get_divisor(struct uart_port *port, unsigned int baud)
422 422
423EXPORT_SYMBOL(uart_get_divisor); 423EXPORT_SYMBOL(uart_get_divisor);
424 424
425/* FIXME: Consistent locking policy */
425static void 426static void
426uart_change_speed(struct uart_state *state, struct ktermios *old_termios) 427uart_change_speed(struct uart_state *state, struct ktermios *old_termios)
427{ 428{
@@ -454,27 +455,30 @@ uart_change_speed(struct uart_state *state, struct ktermios *old_termios)
454 port->ops->set_termios(port, termios, old_termios); 455 port->ops->set_termios(port, termios, old_termios);
455} 456}
456 457
457static inline void 458static inline int
458__uart_put_char(struct uart_port *port, struct circ_buf *circ, unsigned char c) 459__uart_put_char(struct uart_port *port, struct circ_buf *circ, unsigned char c)
459{ 460{
460 unsigned long flags; 461 unsigned long flags;
462 int ret = 0;
461 463
462 if (!circ->buf) 464 if (!circ->buf)
463 return; 465 return 0;
464 466
465 spin_lock_irqsave(&port->lock, flags); 467 spin_lock_irqsave(&port->lock, flags);
466 if (uart_circ_chars_free(circ) != 0) { 468 if (uart_circ_chars_free(circ) != 0) {
467 circ->buf[circ->head] = c; 469 circ->buf[circ->head] = c;
468 circ->head = (circ->head + 1) & (UART_XMIT_SIZE - 1); 470 circ->head = (circ->head + 1) & (UART_XMIT_SIZE - 1);
471 ret = 1;
469 } 472 }
470 spin_unlock_irqrestore(&port->lock, flags); 473 spin_unlock_irqrestore(&port->lock, flags);
474 return ret;
471} 475}
472 476
473static void uart_put_char(struct tty_struct *tty, unsigned char ch) 477static int uart_put_char(struct tty_struct *tty, unsigned char ch)
474{ 478{
475 struct uart_state *state = tty->driver_data; 479 struct uart_state *state = tty->driver_data;
476 480
477 __uart_put_char(state->port, &state->info->xmit, ch); 481 return __uart_put_char(state->port, &state->info->xmit, ch);
478} 482}
479 483
480static void uart_flush_chars(struct tty_struct *tty) 484static void uart_flush_chars(struct tty_struct *tty)