Skip to content

Commit 707631c

Browse files
jhovoldgregkh
authored andcommitted
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: 962963e ("serial: tegra: Switch to using struct tty_port") Signed-off-by: Johan Hovold <[email protected]> Acked-by: Thierry Reding <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent b374c56 commit 707631c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

drivers/tty/serial/serial-tegra.c

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ static void tegra_uart_handle_tx_pio(struct tegra_uart_port *tup)
635635
}
636636

637637
static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
638-
struct tty_port *tty)
638+
struct tty_port *port)
639639
{
640640
do {
641641
char flag = TTY_NORMAL;
@@ -659,13 +659,12 @@ static void tegra_uart_handle_rx_pio(struct tegra_uart_port *tup,
659659
if (tup->uport.ignore_status_mask & UART_LSR_DR)
660660
continue;
661661

662-
if (tty)
663-
tty_insert_flip_char(tty, ch, flag);
662+
tty_insert_flip_char(port, ch, flag);
664663
} while (1);
665664
}
666665

667666
static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup,
668-
struct tty_port *tty,
667+
struct tty_port *port,
669668
unsigned int count)
670669
{
671670
int copied;
@@ -675,17 +674,13 @@ static void tegra_uart_copy_rx_to_tty(struct tegra_uart_port *tup,
675674
return;
676675

677676
tup->uport.icount.rx += count;
678-
if (!tty) {
679-
dev_err(tup->uport.dev, "No tty port\n");
680-
return;
681-
}
682677

683678
if (tup->uport.ignore_status_mask & UART_LSR_DR)
684679
return;
685680

686681
dma_sync_single_for_cpu(tup->uport.dev, tup->rx_dma_buf_phys,
687682
count, DMA_FROM_DEVICE);
688-
copied = tty_insert_flip_string(tty,
683+
copied = tty_insert_flip_string(port,
689684
((unsigned char *)(tup->rx_dma_buf_virt)), count);
690685
if (copied != count) {
691686
WARN_ON(1);

0 commit comments

Comments
 (0)