From 49ddcf3e0e923040ef554d9ea033e0d8ba7e80e1 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Thu, 22 Jun 2017 16:48:49 +0900 Subject: serial: make serial_stub_* to static functions Add missing static to serial_stub_puts(). Unexport serial_stub_{getc,tstc} because they are used locally. Signed-off-by: Masahiro Yamada Reviewed-by: Bin Meng Reviewed-by: Simon Glass --- drivers/serial/serial-uclass.c | 11 +++++++---- drivers/serial/serial.c | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'drivers/serial') diff --git a/drivers/serial/serial-uclass.c b/drivers/serial/serial-uclass.c index a9c4f89e1a..200f4b9fd7 100644 --- a/drivers/serial/serial-uclass.c +++ b/drivers/serial/serial-uclass.c @@ -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 diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index f2bd0e404c..87542f92df 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -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; -- cgit