diff options
| author | Marek Vasut <[email protected]> | 2012-10-06 14:07:01 +0000 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2012-10-17 07:55:50 -0700 |
| commit | bfb7d7a3d61ff23f9dd265a56e8b5cac5bbfd76e (patch) | |
| tree | b41b156583a878f143da54aeb52fd600337b5ad5 /drivers | |
| parent | bfa5b71408da629493838668e4df0ca9d12107bb (diff) | |
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: Marek Vasut <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Tom Rini <[email protected]>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/serial/serial.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index 5bbf3aeb445..d648a73f411 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -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; |
