[U-Boot] [PATCH 1/3] dm: serial: Do not panic if no serial ports are found

Hans de Goede hdegoede at redhat.com
Sun Jul 5 20:56:31 CEST 2015


Some boards simply do not have any serial ports. Also no one will see the
panic message as there is no where to print it if no serial port is found
(and other stdout options are not yet set up at this point).

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 drivers/serial/serial-uclass.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 815fec3..f036499 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -27,7 +27,7 @@ static const unsigned long baudrate_table[] = CONFIG_SYS_BAUDRATE_TABLE;
 #error "Serial is required before relocation - define CONFIG_SYS_MALLOC_F_LEN to make this work"
 #endif
 
-static void serial_find_console_or_panic(void)
+static void serial_find_console(void)
 {
 	struct udevice *dev;
 	int node;
@@ -77,14 +77,12 @@ static void serial_find_console_or_panic(void)
 		}
 #undef INDEX
 	}
-
-	panic_str("No serial driver found");
 }
 
 /* Called prior to relocation */
 int serial_init(void)
 {
-	serial_find_console_or_panic();
+	serial_find_console();
 	gd->flags |= GD_FLG_SERIAL_READY;
 
 	return 0;
@@ -93,7 +91,7 @@ int serial_init(void)
 /* Called after relocation */
 void serial_initialize(void)
 {
-	serial_find_console_or_panic();
+	serial_find_console();
 }
 
 static void _serial_putc(struct udevice *dev, char ch)
-- 
2.4.3



More information about the U-Boot mailing list