[U-Boot] [PATCH 04/10] dm: serial: Don't require device tree to configure a console

Simon Glass sjg at chromium.org
Mon Sep 15 14:57:39 CEST 2014


Allow serial_find_console_or_panic() to work without a device tree.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

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

diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index d04104e..1ac943f 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -25,6 +25,7 @@ struct udevice *cur_dev __attribute__ ((section(".data")));
 
 static void serial_find_console_or_panic(void)
 {
+#ifdef CONFIG_OF_CONTROL
 	int node;
 
 	/* Check for a chosen console */
@@ -44,7 +45,7 @@ static void serial_find_console_or_panic(void)
 			return;
 		cur_dev = NULL;
 	}
-
+#endif
 	/*
 	 * Failing that, get the device with sequence number 0, or in extremis
 	 * just the first serial device we can find. But we insist on having
-- 
2.1.0.rc2.206.gedb03e5



More information about the U-Boot mailing list