浏览代码

serial: meson: hide an unused function

The newly added meson_uart_enable_tx_engine function is only called
from the console setup, not the runtime uart, which has an open-coded
version of the same register access. This produces a harmless warning
when the console code is disabled:

drivers/tty/serial/meson_uart.c:127:13: error: 'meson_uart_enable_tx_engine' defined but not used [-Werror=unused-function]

Let's move the function inside of the #ifdef to avoid the warning.

Fixes: ba50f1df13c8 ("serial: meson: remove unneeded variable assignment in meson_serial_port_write")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Arnd Bergmann 8 年之前
父节点
当前提交
5fa4accf5e
共有 1 个文件被更改,包括 8 次插入9 次删除
  1. 8 9
      drivers/tty/serial/meson_uart.c

+ 8 - 9
drivers/tty/serial/meson_uart.c

@@ -124,15 +124,6 @@ static void meson_uart_stop_rx(struct uart_port *port)
 	writel(val, port->membase + AML_UART_CONTROL);
 	writel(val, port->membase + AML_UART_CONTROL);
 }
 }
 
 
-static void meson_uart_enable_tx_engine(struct uart_port *port)
-{
-	u32 val;
-
-	val = readl(port->membase + AML_UART_CONTROL);
-	val |= AML_UART_TX_EN;
-	writel(val, port->membase + AML_UART_CONTROL);
-}
-
 static void meson_uart_shutdown(struct uart_port *port)
 static void meson_uart_shutdown(struct uart_port *port)
 {
 {
 	unsigned long flags;
 	unsigned long flags;
@@ -451,6 +442,14 @@ static struct uart_ops meson_uart_ops = {
 };
 };
 
 
 #ifdef CONFIG_SERIAL_MESON_CONSOLE
 #ifdef CONFIG_SERIAL_MESON_CONSOLE
+static void meson_uart_enable_tx_engine(struct uart_port *port)
+{
+	u32 val;
+
+	val = readl(port->membase + AML_UART_CONTROL);
+	val |= AML_UART_TX_EN;
+	writel(val, port->membase + AML_UART_CONTROL);
+}
 
 
 static void meson_console_putchar(struct uart_port *port, int ch)
 static void meson_console_putchar(struct uart_port *port, int ch)
 {
 {