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

serial: liteuart: separate rx loop from poll timer

Convert the rx loop into its own dedicated function, and (for now)
call it from the poll timer. This is in preparation for adding irq
support to the receive path.
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-11-gsomlo@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a774aa45
...@@ -68,10 +68,8 @@ static struct uart_driver liteuart_driver = { ...@@ -68,10 +68,8 @@ static struct uart_driver liteuart_driver = {
#endif #endif
}; };
static void liteuart_timer(struct timer_list *t) static void liteuart_rx_chars(struct uart_port *port)
{ {
struct liteuart_port *uart = from_timer(uart, t, timer);
struct uart_port *port = &uart->port;
unsigned char __iomem *membase = port->membase; unsigned char __iomem *membase = port->membase;
u8 ch; u8 ch;
...@@ -88,6 +86,14 @@ static void liteuart_timer(struct timer_list *t) ...@@ -88,6 +86,14 @@ static void liteuart_timer(struct timer_list *t)
} }
tty_flip_buffer_push(&port->state->port); tty_flip_buffer_push(&port->state->port);
}
static void liteuart_timer(struct timer_list *t)
{
struct liteuart_port *uart = from_timer(uart, t, timer);
struct uart_port *port = &uart->port;
liteuart_rx_chars(port);
mod_timer(&uart->timer, jiffies + uart_poll_timeout(port)); mod_timer(&uart->timer, jiffies + uart_poll_timeout(port));
} }
......
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