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

serial: tegra: Remove redundant code and check in tegra_uart_stop_rx()

The serial-tegra driver always uses DMA and hence the driver always
allocates DMA channels. Therefore, the test to see if the RX DMA channel
is initialised in tegra_uart_stop_rx() is unnecessary and so remove
the test and the code that corresponds to the case where the RX DMA
channel is not initialised. Please note that the call to
tegra_uart_stop_rx() should always be before the call to
tegra_uart_shutdown() which will uninitialise the RX DMA channel.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jon Hunter and committed by
Greg Kroah-Hartman
b0e066cc 2230a947

+7 -10
+7 -10
drivers/tty/serial/serial-tegra.c
··· 777 777 tup->ier_shadow = ier; 778 778 tegra_uart_write(tup, ier, UART_IER); 779 779 tup->rx_in_progress = 0; 780 - if (tup->rx_dma_chan) { 781 - dmaengine_terminate_all(tup->rx_dma_chan); 782 - dmaengine_tx_status(tup->rx_dma_chan, tup->rx_cookie, &state); 783 - async_tx_ack(tup->rx_dma_desc); 784 - count = tup->rx_bytes_requested - state.residue; 785 - tegra_uart_copy_rx_to_tty(tup, port, count); 786 - tegra_uart_handle_rx_pio(tup, port); 787 - } else { 788 - tegra_uart_handle_rx_pio(tup, port); 789 - } 780 + dmaengine_terminate_all(tup->rx_dma_chan); 781 + dmaengine_tx_status(tup->rx_dma_chan, tup->rx_cookie, &state); 782 + async_tx_ack(tup->rx_dma_desc); 783 + count = tup->rx_bytes_requested - state.residue; 784 + tegra_uart_copy_rx_to_tty(tup, port, count); 785 + tegra_uart_handle_rx_pio(tup, port); 786 + 790 787 if (tty) { 791 788 tty_flip_buffer_push(port); 792 789 tty_kref_put(tty);