dm: serial: Move a carriage return before a line feed
PATCH 1/1 dm: serial: 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 based on this rule.
--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/serial/serial-uclass.c +3 -2
@@ -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)
Signature · 1 line
2.1.0.27.g96db324
PATCH 1/1 dm: serial: Move a carriage return before a line feed
Quoted 7 lines · Alison Wang
In general, a carriage return needs to execute before a line feed. The patch is to change serial DM driver based on this rule.
Signed-off-by Alison Wang <[email protected]>--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
PATCH 1/1 dm: serial: Move a carriage return before a line feed
In reply to Alison WangHi Alison,
Quoted 16 lines · Alison Wang
In general, a carriage return needs to execute before a line feed. The patch is to change serial DM driver based on this rule.
Signed-off-by Alison Wang <[email protected]>--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/serial/serial-uclass.c +0
-0@@ -123,11 +123,12 @@ static void _serial_putc(struct udevice *dev, char ch)struct dm_serial_ops *ops =serial_get_ops (dev);int err;
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev, char ch) · line 133
Quoted 10 lines
drivers/serial/serial-uclass.c +3
-2+if (ch =='\n' ) +_serial_putc (dev,'\r' ); +do { err = ops->putc (dev, ch); }while (err == -EAGAIN ); -if (ch =='\n' ) -_serial_putc (dev,'\r' ); }
We should also clean up all DM serial driver to remove this handling in their driver. eg: serial_lpuart.c/serial_mxc.c
Regards,
Bin
PATCH 1/1 dm: serial: Move a carriage return before a line feed
Hi, Bin,
Quoted 30 lines
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev,
Quoted 13 lines · Alison Wang
In general, a carriage return needs to execute before a line feed. The patch is to change serial DM driver based on this rule.
Signed-off-by Alison Wang <[email protected]>--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/serial/serial-uclass.cindex 1c447ff..f154eb1 100644drivers/serial/serial-uclass.c +0
-0@@ -123,11 +123,12 @@ static void _serial_putc(struct udevice *dev,char ch)
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev, char ch) · line 133
Quoted 13 lines
drivers/serial/serial-uclass.c +3
-2struct 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' ); }
Quoted 3 lines
We should also clean up all DM serial driver to remove this handling in their driver. eg:
serial_lpuart.c/serial_mxc.c
[Alison Wang] Thanks for your advice. Yes, I agree. This handling in particular driver is redundant.
It seems only serial_lpuart.c and serial_arc.c has this handling. For serial_mxc.c, this handling is only in the non-DM .putc function, but not in the DM .putc function. Do you think it is necessary to change the non-DM .putc function?
Best Regards,
Alison Wang
PATCH 1/1 dm: serial: Move a carriage return before a line feed
Hi Alison,
Quoted 35 lines · Huan Wang
Hi, Bin,
Quoted 30 lines
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev,
Quoted 13 lines · Alison Wang
In general, a carriage return needs to execute before a line feed. The patch is to change serial DM driver based on this rule.
Signed-off-by Alison Wang <[email protected]>--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/serial/serial-uclass.cindex 1c447ff..f154eb1 100644drivers/serial/serial-uclass.c +0
-0@@ -123,11 +123,12 @@ static void _serial_putc(struct udevice *dev,char ch)
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev, char ch) · line 133
Quoted 13 lines
drivers/serial/serial-uclass.c +3
-2struct 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' ); }Quoted 3 lines
We should also clean up all DM serial driver to remove this handling in their driver. eg:
serial_lpuart.c/serial_mxc.c
Quoted 8 lines
[Alison Wang] Thanks for your advice. Yes, I agree. This handling in particular driver is redundant.
It seems only
serial_lpuart.candserial_arc.chas this handling. Forserial_mxc.c, this handling is only in the non-DM .putc function, but not in the DM .putc function. Do you think it is necessary to change the non-DM .putc function?
No, we should keep the non-DM putc function as it is now. But this serial_mxc.c, its non-DM putc version has the same issue as the serial-uclass.c, so it should be fixed. The legacy serial_pxa.c, serial_s3c24x0.c and usbtty.c also have the same problem.
Regards,
Bin
PATCH 1/1 dm: serial: Move a carriage return before a line feed
Hi, Bin,
Quoted 45 lines · Huan Wang
Quoted 35 lines
Hi, Bin,
Quoted 30 lines
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev,
Quoted 13 lines · Alison Wang
In general, a carriage return needs to execute before a line feed. The patch is to change serial DM driver based on this rule.
Signed-off-by Alison Wang <[email protected]>--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)(quoted diff) +0
-0
b/drivers/serial/serial-uclass.cindex 1c447ff..f154eb1 100644drivers/serial/serial-uclass.c +0
-0@@ -123,11 +123,12 @@ static void _serial_putc(struct udevice *dev,char ch)
drivers/serial/serial-uclass.c static void _serial_putc(struct udevice *dev, char ch) · line 133
Quoted 13 lines
drivers/serial/serial-uclass.c +3
-2struct 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' ); }Quoted 3 lines
We should also clean up all DM serial driver to remove this handling in their driver. eg:
serial_lpuart.c/serial_mxc.cQuoted 8 lines
[Alison Wang] Thanks for your advice. Yes, I agree. This handling in particular driver is redundant.
It seems only
serial_lpuart.candserial_arc.chas this handling. Forserial_mxc.c, this handling is only in the non-DM .putc function, but not in the DM .putc function. Do you think it is necessary to change the non-DM .putc function?
Quoted 6 lines
No, we should keep the non-DM putc function as it is now. But this
serial_mxc.c, its non-DM putc version has the same issue as the serial-uclass.c, so it should be fixed. The legacyserial_pxa.c,serial_s3c24x0.candusbtty.calso have the same problem.
[Alison Wang] Ok, I get your idea. I will send another patch to fix them.
Thanks.
Best Regards,
Alison Wang
PATCH 1/1 dm: serial: Move a carriage return before a line feed
In reply to Alison WangQuoted 8 lines · Alison Wang
In general, a carriage return needs to execute before a line feed. The patch is to change serial DM driver based on this rule.
Signed-off-by Alison Wang <[email protected]>--- drivers/serial/serial-uclass.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)