Commit f1c6c8b1 authored by Gabriel Somlo's avatar Gabriel Somlo Committed by Greg Kroah-Hartman

serial: liteuart: move polling putchar() function

The polling liteuart_putchar() function is only called from methods
conditionally enabled by CONFIG_SERIAL_LITEUART_CONSOLE. Move its
definition closer to the console code where it is dependent on the
same config option.
Signed-off-by: default avatarGabriel Somlo <gsomlo@gmail.com>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: default avatarJiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20221123130500.1030189-15-gsomlo@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 01a305a3
...@@ -70,14 +70,6 @@ static struct uart_driver liteuart_driver = { ...@@ -70,14 +70,6 @@ static struct uart_driver liteuart_driver = {
#endif #endif
}; };
static void liteuart_putchar(struct uart_port *port, unsigned char ch)
{
while (litex_read8(port->membase + OFF_TXFULL))
cpu_relax();
litex_write8(port->membase + OFF_RXTX, ch);
}
static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask) static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask)
{ {
struct liteuart_port *uart = to_liteuart_port(port); struct liteuart_port *uart = to_liteuart_port(port);
...@@ -377,6 +369,14 @@ static struct platform_driver liteuart_platform_driver = { ...@@ -377,6 +369,14 @@ static struct platform_driver liteuart_platform_driver = {
#ifdef CONFIG_SERIAL_LITEUART_CONSOLE #ifdef CONFIG_SERIAL_LITEUART_CONSOLE
static void liteuart_putchar(struct uart_port *port, unsigned char ch)
{
while (litex_read8(port->membase + OFF_TXFULL))
cpu_relax();
litex_write8(port->membase + OFF_RXTX, ch);
}
static void liteuart_console_write(struct console *co, const char *s, static void liteuart_console_write(struct console *co, const char *s,
unsigned int count) unsigned int count)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment