diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:54:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:47 -0400 |
commit | 23d22cea85ba9114a59a32ca8dfb1e2aef52a278 (patch) | |
tree | 300a122ecc3583454058de7c2a7c01a7a2322cef | |
parent | 56dbbb9a5704f665068778d4d2c1bdf757756e60 (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>
-rw-r--r-- | drivers/serial/serial_core.c | 12 |
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 | ||
423 | EXPORT_SYMBOL(uart_get_divisor); | 423 | EXPORT_SYMBOL(uart_get_divisor); |
424 | 424 | ||
425 | /* FIXME: Consistent locking policy */ | ||
425 | static void | 426 | static void |
426 | uart_change_speed(struct uart_state *state, struct ktermios *old_termios) | 427 | uart_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 | ||
457 | static inline void | 458 | static 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 | ||
473 | static void uart_put_char(struct tty_struct *tty, unsigned char ch) | 477 | static 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 | ||
480 | static void uart_flush_chars(struct tty_struct *tty) | 484 | static void uart_flush_chars(struct tty_struct *tty) |