[U-Boot] [PATCH v2 2/4] Enable printf() console if pre-console putc() is available

Simon Glass sjg at chromium.org
Fri Mar 9 21:32:56 CET 2012


At present we skip printf() if there is no hope of it making it to the
console. But this check ignores CONFIG_PRE_CONSOLE_PUTC at present.
Add a check for that also.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v2:
- Allow printf() output to make it to pre-console putc()

 common/console.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/common/console.c b/common/console.c
index 1d9fd7f..38d7094 100644
--- a/common/console.c
+++ b/common/console.c
@@ -447,7 +447,7 @@ int vprintf(const char *fmt, va_list args)
 	uint i;
 	char printbuffer[CONFIG_SYS_PBSIZE];
 
-#ifndef CONFIG_PRE_CONSOLE_BUFFER
+#if !defined(CONFIG_PRE_CONSOLE_BUFFER) && !defined(CONFIG_PRE_CONSOLE_PUTC)
 	if (!gd->have_console)
 		return 0;
 #endif
-- 
1.7.7.3



More information about the U-Boot mailing list