serial: make serial_stub_* to static functions
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 22 Jun 2017 07:48:49 +0000 (16:48 +0900)
committerTom Rini <trini@konsulko.com>
Thu, 6 Jul 2017 17:09:35 +0000 (13:09 -0400)
Add missing static to serial_stub_puts().

Unexport serial_stub_{getc,tstc} because they are used locally.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/serial/serial-uclass.c
drivers/serial/serial.c
include/common.h

index a9c4f89..200f4b9 100644 (file)
@@ -212,27 +212,30 @@ void serial_stdio_init(void)
 {
 }
 
-#if defined(CONFIG_DM_STDIO) && CONFIG_IS_ENABLED(SERIAL_PRESENT)
+#if defined(CONFIG_DM_STDIO)
+
+#if CONFIG_IS_ENABLED(SERIAL_PRESENT)
 static void serial_stub_putc(struct stdio_dev *sdev, const char ch)
 {
        _serial_putc(sdev->priv, ch);
 }
 #endif
 
-void serial_stub_puts(struct stdio_dev *sdev, const char *str)
+static void serial_stub_puts(struct stdio_dev *sdev, const char *str)
 {
        _serial_puts(sdev->priv, str);
 }
 
-int serial_stub_getc(struct stdio_dev *sdev)
+static int serial_stub_getc(struct stdio_dev *sdev)
 {
        return _serial_getc(sdev->priv);
 }
 
-int serial_stub_tstc(struct stdio_dev *sdev)
+static int serial_stub_tstc(struct stdio_dev *sdev)
 {
        return _serial_tstc(sdev->priv);
 }
+#endif
 
 /**
  * on_baudrate() - Update the actual baudrate when the env var changes
index f2bd0e4..87542f9 100644 (file)
@@ -273,14 +273,14 @@ static void serial_stub_puts(struct stdio_dev *sdev, const char *str)
        dev->puts(str);
 }
 
-int serial_stub_getc(struct stdio_dev *sdev)
+static int serial_stub_getc(struct stdio_dev *sdev)
 {
        struct serial_device *dev = sdev->priv;
 
        return dev->getc();
 }
 
-int serial_stub_tstc(struct stdio_dev *sdev)
+static int serial_stub_tstc(struct stdio_dev *sdev)
 {
        struct serial_device *dev = sdev->priv;
 
index 638c45b..1a98512 100644 (file)
@@ -490,11 +490,6 @@ void       serial_puts   (const char *);
 int    serial_getc   (void);
 int    serial_tstc   (void);
 
-/* These versions take a stdio_dev pointer */
-struct stdio_dev;
-int serial_stub_getc(struct stdio_dev *sdev);
-int serial_stub_tstc(struct stdio_dev *sdev);
-
 /* $(CPU)/speed.c */
 int    get_clocks (void);
 ulong  get_bus_freq  (ulong);