[U-Boot] [PATCH v2 2/8] dm: serial: fix console putc

Masahiro Yamada yamada.m at jp.panasonic.com
Thu Oct 23 15:26:06 CEST 2014


Commit b8893327e9d2 (dm: serial: Put common code into separate functions)
consolidated getc() correctly, but introduced another bug to putc();
serial_stub_putc() passes sdev->priv to serial_putc_dev(), but
serial_putc_dev() uses cur_dev instead of the given argument.

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
---

Changes in v2:
  - Newly added

 drivers/serial/serial-uclass.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 1a75950..f2bc4d8 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -73,14 +73,14 @@ void serial_initialize(void)
 
 static void serial_putc_dev(struct udevice *dev, char ch)
 {
-	struct dm_serial_ops *ops = serial_get_ops(cur_dev);
+	struct dm_serial_ops *ops = serial_get_ops(dev);
 	int err;
 
 	do {
-		err = ops->putc(cur_dev, ch);
+		err = ops->putc(dev, ch);
 	} while (err == -EAGAIN);
 	if (ch == '\n')
-		serial_putc('\r');
+		serial_putc_dev(dev, '\r');
 }
 
 void serial_putc(char ch)
-- 
1.9.1



More information about the U-Boot mailing list