From: Alison Wang Date: Wed, 2 Mar 2016 03:00:36 +0000 (+0800) Subject: dm: serial-uclass: Move a carriage return before a line feed X-Git-Tag: v2016.05-rc1~420^2~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c5917b4b054d60c6c495f06b0538afed39dfe343;p=u-boot 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 Reviewed-by: Bin Meng --- 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)