Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
Linus Torvalds
23d22cea 56dbbb9a

+8 -4
+8 -4
drivers/serial/serial_core.c
··· 422 422 423 423 EXPORT_SYMBOL(uart_get_divisor); 424 424 425 + /* FIXME: Consistent locking policy */ 425 426 static void 426 427 uart_change_speed(struct uart_state *state, struct ktermios *old_termios) 427 428 { ··· 455 454 port->ops->set_termios(port, termios, old_termios); 456 455 } 457 456 458 - static inline void 457 + static inline int 459 458 __uart_put_char(struct uart_port *port, struct circ_buf *circ, unsigned char c) 460 459 { 461 460 unsigned long flags; 461 + int ret = 0; 462 462 463 463 if (!circ->buf) 464 - return; 464 + return 0; 465 465 466 466 spin_lock_irqsave(&port->lock, flags); 467 467 if (uart_circ_chars_free(circ) != 0) { 468 468 circ->buf[circ->head] = c; 469 469 circ->head = (circ->head + 1) & (UART_XMIT_SIZE - 1); 470 + ret = 1; 470 471 } 471 472 spin_unlock_irqrestore(&port->lock, flags); 473 + return ret; 472 474 } 473 475 474 - static void uart_put_char(struct tty_struct *tty, unsigned char ch) 476 + static int uart_put_char(struct tty_struct *tty, unsigned char ch) 475 477 { 476 478 struct uart_state *state = tty->driver_data; 477 479 478 - __uart_put_char(state->port, &state->info->xmit, ch); 480 + return __uart_put_char(state->port, &state->info->xmit, ch); 479 481 } 480 482 481 483 static void uart_flush_chars(struct tty_struct *tty)