[PATCH] console: When deactivating a console, flush it first

Sascha Hauer s.hauer at pengutronix.de
Thu Jul 23 06:24:58 PDT 2015


Otherwise the last characters may not be sent before deactivating
a console.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/console.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/console.c b/common/console.c
index 0a6fc3e..bf64c08 100644
--- a/common/console.c
+++ b/common/console.c
@@ -73,6 +73,9 @@ int console_set_active(struct console_device *cdev, unsigned flag)
 			cdev->setbrg(cdev, cdev->baudrate);
 	}
 
+	if (!flag && cdev->f_active && cdev->flush)
+		cdev->flush(cdev);
+
 	if (cdev->set_active) {
 		ret = cdev->set_active(cdev, flag);
 		if (ret)
-- 
2.1.4




More information about the barebox mailing list