diff options
author | Alison Wang <b18965@freescale.com> | 2016-03-02 11:00:36 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2016-03-14 15:34:50 -0600 |
commit | c5917b4b054d60c6c495f06b0538afed39dfe343 (patch) | |
tree | 2dfec02e4bf4367b9d248dafd6d27bd62d109c78 | |
parent | eea1d148f3c653b23e96a2f842c3760b4cbbaa51 (diff) | |
download | u-boot-c5917b4b054d60c6c495f06b0538afed39dfe343.tar.gz u-boot-c5917b4b054d60c6c495f06b0538afed39dfe343.tar.xz u-boot-c5917b4b054d60c6c495f06b0538afed39dfe343.zip |
dm: serial-uclass: Move a carriage return before a line feed
In general, a carriage return needs to execute before a line feed. The
patch is to change serial DM driver serial-uclass.c based on this rule.
Signed-off-by: Alison Wang <alison.wang@nxp.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
-rw-r--r-- | drivers/serial/serial-uclass.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index 1c447ff27a..f154eb156c 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -123,11 +123,12 @@ static void _serial_putc(struct udevice *dev, char ch) struct dm_serial_ops *ops = serial_get_ops(dev); int err; + if (ch == '\n') + _serial_putc(dev, '\r'); + do { err = ops->putc(dev, ch); } while (err == -EAGAIN); - if (ch == '\n') - _serial_putc(dev, '\r'); } static void _serial_puts(struct udevice *dev, const char *str) |