Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Gabriel Somlo <gsomlo@gmail.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20221123130500.1030189-15-gsomlo@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Gabriel Somlo and committed by
Greg Kroah-Hartman
f1c6c8b1 01a305a3

+8 -8
+8 -8
drivers/tty/serial/liteuart.c
··· 70 70 #endif 71 71 }; 72 72 73 - static void liteuart_putchar(struct uart_port *port, unsigned char ch) 74 - { 75 - while (litex_read8(port->membase + OFF_TXFULL)) 76 - cpu_relax(); 77 - 78 - litex_write8(port->membase + OFF_RXTX, ch); 79 - } 80 - 81 73 static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask) 82 74 { 83 75 struct liteuart_port *uart = to_liteuart_port(port); ··· 368 376 }; 369 377 370 378 #ifdef CONFIG_SERIAL_LITEUART_CONSOLE 379 + 380 + static void liteuart_putchar(struct uart_port *port, unsigned char ch) 381 + { 382 + while (litex_read8(port->membase + OFF_TXFULL)) 383 + cpu_relax(); 384 + 385 + litex_write8(port->membase + OFF_RXTX, ch); 386 + } 371 387 372 388 static void liteuart_console_write(struct console *co, const char *s, 373 389 unsigned int count)