[U-Boot] [PATCH 62/71] serial: spl: Implement empty functions for SPL

Marek Vasut
2012-09-16T23:21:27Z

Implement empty serial_* functions for SPL without serial
support enabled. This is imperative to haave once serial
multi is enabled unconditionally.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tom Rini <trini@ti.com>
---
common/serial.c | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/common/serial.c b/common/serial.c
index 631af65..cef4ba8 100644
--- a/common/serial.c
+++ b/common/serial.c
@@ -27,6 +27,16 @@
#include <post.h>
#include <linux/compiler.h>

+/* Implement prototypes for SPL without serial support */
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_SERIAL_SUPPORT)
+int serial_init(void) { return 0; }
+void serial_setbrg(void) {}
+int serial_getc(void) { return 0; }
+int serial_tstc(void) { return 0; }
+void serial_putc(const char c) {}
+void serial_puts(const char *s) {}
+#else
+
DECLARE_GLOBAL_DATA_PTR;

static struct serial_device *serial_devices;
@@ -344,3 +354,5 @@ int uart_post_test(int flags)
return ret;
}
#endif
+
+#endif
--
1.7.10.4