mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-18 21:21:37 +00:00
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>
This commit is contained in:
parent
eea1d148f3
commit
c5917b4b05
1 changed files with 3 additions and 2 deletions
|
@ -123,11 +123,12 @@ static void _serial_putc(struct udevice *dev, char ch)
|
||||||
struct dm_serial_ops *ops = serial_get_ops(dev);
|
struct dm_serial_ops *ops = serial_get_ops(dev);
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
if (ch == '\n')
|
||||||
|
_serial_putc(dev, '\r');
|
||||||
|
|
||||||
do {
|
do {
|
||||||
err = ops->putc(dev, ch);
|
err = ops->putc(dev, ch);
|
||||||
} while (err == -EAGAIN);
|
} while (err == -EAGAIN);
|
||||||
if (ch == '\n')
|
|
||||||
_serial_putc(dev, '\r');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _serial_puts(struct udevice *dev, const char *str)
|
static void _serial_puts(struct udevice *dev, const char *str)
|
||||||
|
|
Loading…
Add table
Reference in a new issue