[Concept,15/18] ulib: Drop the initial banner for the library

Message ID 20250904130459.848794-16-sjg@u-boot.org
State New
Headers
Series ulib: Introduce building U-Boot as a shared library |

Commit Message

Simon Glass Sept. 4, 2025, 1:04 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

When using the library it should start up silently. Drop the initial
banner.

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

 lib/display_options.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
  

Patch

diff --git a/lib/display_options.c b/lib/display_options.c
index 9c6722f0c64..7f9dfcc43ee 100644
--- a/lib/display_options.c
+++ b/lib/display_options.c
@@ -9,11 +9,14 @@ 
 #include <display_options.h>
 #include <div64.h>
 #include <version_string.h>
-#include <linux/ctype.h>
-#include <linux/kernel.h>
-#include <asm/io.h>
 #include <stdio.h>
 #include <vsprintf.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <linux/ctype.h>
+#include <linux/kernel.h>
+
+DECLARE_GLOBAL_DATA_PTR;
 
 char *display_options_get_banner_priv(bool newlines, const char *build_tag,
 				      char *buf, int size)
@@ -47,8 +50,10 @@  int display_options(void)
 {
 	char buf[DISPLAY_OPTIONS_BANNER_LENGTH];
 
-	display_options_get_banner(true, buf, sizeof(buf));
-	printf("%s", buf);
+	if (!gd_ulib()) {
+		display_options_get_banner(true, buf, sizeof(buf));
+		printf("%s", buf);
+	}
 
 	return 0;
 }