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

tty: serial: qcom_geni_serial: Remove set_rfr_wm() and related variables

The variables of tx_wm and rx_wm were set to the same define value in
all cases, never updated, and the define was sometimes used
interchangably. Remove the variables/function and use the fixed value.

Signed-off-by: Ryan Case <ryandcase@chromium.org>
Reviewed-by: Evan Green <evgreen@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ryan Case and committed by
Greg Kroah-Hartman
a85fb9ce 9e06d55f

+4 -21
+4 -21
drivers/tty/serial/qcom_geni_serial.c
··· 89 89 #define DEF_FIFO_DEPTH_WORDS 16 90 90 #define DEF_TX_WM 2 91 91 #define DEF_FIFO_WIDTH_BITS 32 92 - #define UART_CONSOLE_RX_WM 2 92 + #define UART_RX_WM 2 93 93 #define MAX_LOOPBACK_CFG 3 94 94 95 95 #ifdef CONFIG_CONSOLE_POLL ··· 105 105 u32 tx_fifo_depth; 106 106 u32 tx_fifo_width; 107 107 u32 rx_fifo_depth; 108 - u32 tx_wm; 109 - u32 rx_wm; 110 - u32 rx_rfr; 111 108 enum geni_se_xfer_mode xfer_mode; 112 109 bool setup; 113 110 int (*handle_rx)(struct uart_port *uport, u32 bytes, bool drop); ··· 360 363 static void qcom_geni_serial_poll_put_char(struct uart_port *uport, 361 364 unsigned char c) 362 365 { 363 - struct qcom_geni_serial_port *port = to_dev_port(uport, uport); 364 - 365 - writel(port->tx_wm, uport->membase + SE_GENI_TX_WATERMARK_REG); 366 + writel(DEF_TX_WM, uport->membase + SE_GENI_TX_WATERMARK_REG); 366 367 qcom_geni_serial_setup_tx(uport, 1); 367 368 WARN_ON(!qcom_geni_serial_poll_bit(uport, SE_GENI_M_IRQ_STATUS, 368 369 M_TX_FIFO_WATERMARK_EN, true)); ··· 569 574 irq_en = readl(uport->membase + SE_GENI_M_IRQ_EN); 570 575 irq_en |= M_TX_FIFO_WATERMARK_EN | M_CMD_DONE_EN; 571 576 572 - writel(port->tx_wm, uport->membase + 577 + writel(DEF_TX_WM, uport->membase + 573 578 SE_GENI_TX_WATERMARK_REG); 574 579 writel(irq_en, uport->membase + SE_GENI_M_IRQ_EN); 575 580 } ··· 841 846 (port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE; 842 847 } 843 848 844 - static void set_rfr_wm(struct qcom_geni_serial_port *port) 845 - { 846 - /* 847 - * Set RFR (Flow off) to FIFO_DEPTH - 2. 848 - * RX WM level at 10% RX_FIFO_DEPTH. 849 - * TX WM level at 10% TX_FIFO_DEPTH. 850 - */ 851 - port->rx_rfr = port->rx_fifo_depth - 2; 852 - port->rx_wm = UART_CONSOLE_RX_WM; 853 - port->tx_wm = DEF_TX_WM; 854 - } 855 849 856 850 static void qcom_geni_serial_shutdown(struct uart_port *uport) 857 851 { ··· 881 897 882 898 get_tx_fifo_size(port); 883 899 884 - set_rfr_wm(port); 885 900 writel(rxstale, uport->membase + SE_UART_RX_STALE_CNT); 886 901 /* 887 902 * Make an unconditional cancel on the main sequencer to reset ··· 893 910 false, true, false); 894 911 geni_se_config_packing(&port->se, BITS_PER_BYTE, port->rx_bytes_pw, 895 912 false, false, true); 896 - geni_se_init(&port->se, port->rx_wm, port->rx_rfr); 913 + geni_se_init(&port->se, UART_RX_WM, port->rx_fifo_depth - 2); 897 914 geni_se_select_mode(&port->se, port->xfer_mode); 898 915 if (!uart_console(uport)) { 899 916 port->rx_fifo = devm_kcalloc(uport->dev,