X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=drivers%2Fserial%2Fserial_core.c;h=fcd7744c4253fa390b28806baf3b093d97d82339;hb=950709a8961e2dde05bc55dca29b2d2e54a6d3ec;hp=cc1faa31d124f0308a565970bc968245cf73f351;hpb=61c5504a0ed66c8b460f9a006eedaea2ee587e33;p=powerpc.git diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index cc1faa31d1..fcd7744c42 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -1754,6 +1754,27 @@ static int uart_read_proc(char *page, char **start, off_t off, #endif #ifdef CONFIG_SERIAL_CORE_CONSOLE +/* + * uart_console_write - write a console message to a serial port + * @port: the port to write the message + * @s: array of characters + * @count: number of characters in string to write + * @write: function to write character to port + */ +void uart_console_write(struct uart_port *port, const char *s, + unsigned int count, + void (*putchar)(struct uart_port *, int)) +{ + unsigned int i; + + for (i = 0; i < count; i++, s++) { + if (*s == '\n') + putchar(port, '\r'); + putchar(port, *s); + } +} +EXPORT_SYMBOL_GPL(uart_console_write); + /* * Check whether an invalid uart number has been specified, and * if so, search for the first available port that does have