Skip to content
Snippets Groups Projects
Commit bfb7d7a3 authored by Marek Vasut's avatar Marek Vasut Committed by Tom Rini
Browse files

serial: Implement default_serial_puts()


U-Boot contains a lot of duplicit implementations of serial_puts()
call which just pipes single characters into the port in loop. Implement
function that does this behavior into common code, so others can make
easy use of it.

This function is called default_serial_puts() and it's sole purpose
is to call putc() in loop on the whole string passed to it.

Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
parent bfa5b714
No related branches found
No related tags found
No related merge requests found
......@@ -273,6 +273,13 @@ void serial_puts(const char *s)
get_current()->puts(s);
}
void default_serial_puts(const char *s)
{
struct serial_device *dev = get_current();
while (*s)
dev->putc(*s++);
}
#if CONFIG_POST & CONFIG_SYS_POST_UART
static const int bauds[] = CONFIG_SYS_BAUDRATE_TABLE;
......
......@@ -20,6 +20,8 @@ struct serial_device {
struct serial_device *next;
};
void default_serial_puts(const char *s);
extern struct serial_device serial_smc_device;
extern struct serial_device serial_scc_device;
extern struct serial_device *default_serial_console(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment