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

Configure Feed

Select the types of activity you want to include in your feed.

serial: 8250: extract serial8250_set_ier()

serial8250_do_set_termios() consists of many registers and up flags
settings. Extract all these into separate functions. This time, setting
of IER.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20250611100319.186924-23-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
b3be8701 555ce50f

+17 -14
+17 -14
drivers/tty/serial/8250/8250_port.c
··· 2752 2752 port->ignore_status_mask |= UART_LSR_DR; 2753 2753 } 2754 2754 2755 + static void serial8250_set_ier(struct uart_port *port, struct ktermios *termios) 2756 + { 2757 + struct uart_8250_port *up = up_to_u8250p(port); 2758 + 2759 + /* CTS flow control flag and modem status interrupts */ 2760 + up->ier &= ~UART_IER_MSI; 2761 + if (!(up->bugs & UART_BUG_NOMSR) && UART_ENABLE_MS(&up->port, termios->c_cflag)) 2762 + up->ier |= UART_IER_MSI; 2763 + if (up->capabilities & UART_CAP_UUE) 2764 + up->ier |= UART_IER_UUE; 2765 + if (up->capabilities & UART_CAP_RTOIE) 2766 + up->ier |= UART_IER_RTOIE; 2767 + 2768 + serial_port_out(port, UART_IER, up->ier); 2769 + } 2770 + 2755 2771 void 2756 2772 serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios, 2757 2773 const struct ktermios *old) ··· 2796 2780 serial8250_set_afe(port, termios); 2797 2781 uart_update_timeout(port, termios->c_cflag, baud); 2798 2782 serial8250_set_errors_and_ignores(port, termios); 2799 - 2800 - /* 2801 - * CTS flow control flag and modem status interrupts 2802 - */ 2803 - up->ier &= ~UART_IER_MSI; 2804 - if (!(up->bugs & UART_BUG_NOMSR) && 2805 - UART_ENABLE_MS(&up->port, termios->c_cflag)) 2806 - up->ier |= UART_IER_MSI; 2807 - if (up->capabilities & UART_CAP_UUE) 2808 - up->ier |= UART_IER_UUE; 2809 - if (up->capabilities & UART_CAP_RTOIE) 2810 - up->ier |= UART_IER_RTOIE; 2811 - 2812 - serial_port_out(port, UART_IER, up->ier); 2783 + serial8250_set_ier(port, termios); 2813 2784 2814 2785 if (up->capabilities & UART_CAP_EFR) { 2815 2786 unsigned char efr = 0;