From: Heiko Schocher <hs@denx.de>
Date: Wed, 2 Feb 2022 12:55:19 +0000 (+0100)
Subject: serial-uclass: fix build warning
X-Git-Tag: v2025.01-rc5-pxa1908~1541^2~6
X-Git-Url: http://git.dujemihanovic.xyz/%22mailto:Murray.Jensen%40csiro.au/static/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=3ed8c4c88379557cce495b3b703c3b393db2d648;p=u-boot.git

serial-uclass: fix build warning

if CONFIG_DM_STDIO is defined but SERIAL_PRESENT not,
gcc drops warnings for serial_stub_* functions
that they are defined but not used.

Fix it.

Signed-off-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
---

diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c
index 96a1cb65ba..362cedd955 100644
--- a/drivers/serial/serial-uclass.c
+++ b/drivers/serial/serial-uclass.c
@@ -357,7 +357,6 @@ static void serial_stub_putc(struct stdio_dev *sdev, const char ch)
 {
 	_serial_putc(sdev->priv, ch);
 }
-#endif
 
 static void serial_stub_puts(struct stdio_dev *sdev, const char *str)
 {
@@ -374,6 +373,7 @@ static int serial_stub_tstc(struct stdio_dev *sdev)
 	return _serial_tstc(sdev->priv);
 }
 #endif
+#endif
 
 /**
  * on_baudrate() - Update the actual baudrate when the env var changes