summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-11-14 22:57:23 +0300
committerTom Rini <trini@konsulko.com>2019-12-03 02:23:10 +0300
commitf516fd99ec59d964836906c8ac370f246d60c14d (patch)
treea3247c000d7a32a3869d914393b5b99139d2cc95 /include
parent2310c8ede3341757ca78885c25262a30e520a3ff (diff)
downloadu-boot-f516fd99ec59d964836906c8ac370f246d60c14d.tar.xz
common: Move serial_printf() to the serial header
Move this function header to serial.h since this function is clearly related to serial. The function itself stays in console.c since we don't have a single serial file. DM and non-DM each has a separate file so we would have to either create a new common serial file, or repeat the function in both serial.c and serial-uclass.c, neither of which seem worthwhile. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include')
-rw-r--r--include/common.h7
-rw-r--r--include/serial.h11
2 files changed, 11 insertions, 7 deletions
diff --git a/include/common.h b/include/common.h
index 4fda40cc1d..f97a7b6e14 100644
--- a/include/common.h
+++ b/include/common.h
@@ -310,13 +310,6 @@ int ulz4fn(const void *src, size_t srcn, void *dst, size_t *dstn);
/* lib/vsprintf.c */
#include <vsprintf.h>
-/*
- * STDIO based functions (can always be used)
- */
-/* serial stuff */
-int serial_printf (const char *fmt, ...)
- __attribute__ ((format (__printf__, 1, 2)));
-
/* lib/net_utils.c */
#include <net.h>
diff --git a/include/serial.h b/include/serial.h
index 38a1cc99ae..8d1803c800 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -324,4 +324,15 @@ void pl01x_serial_initialize(void);
void pxa_serial_initialize(void);
void sh_serial_initialize(void);
+/**
+ * serial_printf() - Write a formatted string to the serial console
+ *
+ * The total size of the output must be less than CONFIG_SYS_PBSIZE.
+ *
+ * @fmt: Printf format string, followed by format arguments
+ * @return number of characters written
+ */
+int serial_printf(const char *fmt, ...)
+ __attribute__ ((format (__printf__, 1, 2)));
+
#endif