Commit 707631ce authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

serial: tegra: drop bogus NULL tty-port checks

The struct tty_port is part of the uart state and will never be NULL in
the receive helpers. Drop the bogus NULL checks and rename the
pointer-variables "port" to differentiate them from struct tty_struct
pointers (which can be NULL).

Fixes: 962963e4 ("serial: tegra: Switch to using struct tty_port")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20200710135947.2737-3-johan@kernel.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b374c562
...@@ -635,7 +635,7 @@ static void tegra_uart_handle_tx_pio(struct tegra_uart_port *tup) ...@@ -635,7 +635,7 @@ static void tegra_uart_handle_tx_pio(struct tegra_uart_port *tup)
} }
static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup, static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
struct tty_port *tty) struct tty_port *port)
{ {
do { do {
char flag = TTY_NORMAL; char flag = TTY_NORMAL;
...@@ -659,13 +659,12 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup, ...@@ -659,13 +659,12 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
if (tup->uport.ignore_status_mask & UART_LSR_DR) if (tup->uport.ignore_status_mask & UART_LSR_DR)
continue; continue;
if (tty) tty_insert_flip_char(port, ch, flag);
tty_insert_flip_char(tty, ch, flag);
} while (1); } while (1);
} }
static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup, static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup,
struct tty_port *tty, struct tty_port *port,
unsigned int count) unsigned int count)
{ {
int copied; int copied;
...@@ -675,17 +674,13 @@ static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup, ...@@ -675,17 +674,13 @@ static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup,
return; return;
tup->uport.icount.rx += count; tup->uport.icount.rx += count;
if (!tty) {
dev_err(tup->uport.dev, "No tty port\n");
return;
}
if (tup->uport.ignore_status_mask & UART_LSR_DR) if (tup->uport.ignore_status_mask & UART_LSR_DR)
return; return;
dma_sync_single_for_cpu(tup->uport.dev, tup->rx_dma_buf_phys, dma_sync_single_for_cpu(tup->uport.dev, tup->rx_dma_buf_phys,
count, DMA_FROM_DEVICE); count, DMA_FROM_DEVICE);
copied = tty_insert_flip_string(tty, copied = tty_insert_flip_string(port,
((unsigned char *)(tup->rx_dma_buf_virt)), count); ((unsigned char *)(tup->rx_dma_buf_virt)), count);
if (copied != count) { if (copied != count) {
WARN_ON(1); WARN_ON(1);
......
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