serial: Make ->set_termios() old ktermios const
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 16 Aug 2022 11:57:37 +0000 (14:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Aug 2022 12:22:35 +0000 (14:22 +0200)
There should be no reason to adjust old ktermios which is going to get
discarded anyway.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220816115739.10928-7-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
82 files changed:
drivers/tty/serial/21285.c
drivers/tty/serial/8250/8250_bcm7271.c
drivers/tty/serial/8250/8250_dw.c
drivers/tty/serial/8250/8250_dwlib.c
drivers/tty/serial/8250/8250_dwlib.h
drivers/tty/serial/8250/8250_fintek.c
drivers/tty/serial/8250/8250_lpss.c
drivers/tty/serial/8250/8250_mid.c
drivers/tty/serial/8250/8250_mtk.c
drivers/tty/serial/8250/8250_omap.c
drivers/tty/serial/8250/8250_port.c
drivers/tty/serial/altera_jtaguart.c
drivers/tty/serial/altera_uart.c
drivers/tty/serial/amba-pl010.c
drivers/tty/serial/amba-pl011.c
drivers/tty/serial/apbuart.c
drivers/tty/serial/ar933x_uart.c
drivers/tty/serial/arc_uart.c
drivers/tty/serial/atmel_serial.c
drivers/tty/serial/bcm63xx_uart.c
drivers/tty/serial/clps711x.c
drivers/tty/serial/cpm_uart/cpm_uart_core.c
drivers/tty/serial/digicolor-usart.c
drivers/tty/serial/dz.c
drivers/tty/serial/fsl_linflexuart.c
drivers/tty/serial/fsl_lpuart.c
drivers/tty/serial/icom.c
drivers/tty/serial/imx.c
drivers/tty/serial/ip22zilog.c
drivers/tty/serial/jsm/jsm_tty.c
drivers/tty/serial/lantiq.c
drivers/tty/serial/liteuart.c
drivers/tty/serial/lpc32xx_hs.c
drivers/tty/serial/max3100.c
drivers/tty/serial/max310x.c
drivers/tty/serial/mcf.c
drivers/tty/serial/men_z135_uart.c
drivers/tty/serial/meson_uart.c
drivers/tty/serial/milbeaut_usio.c
drivers/tty/serial/mpc52xx_uart.c
drivers/tty/serial/mps2-uart.c
drivers/tty/serial/msm_serial.c
drivers/tty/serial/mux.c
drivers/tty/serial/mvebu-uart.c
drivers/tty/serial/mxs-auart.c
drivers/tty/serial/omap-serial.c
drivers/tty/serial/owl-uart.c
drivers/tty/serial/pch_uart.c
drivers/tty/serial/pic32_uart.c
drivers/tty/serial/pmac_zilog.c
drivers/tty/serial/pxa.c
drivers/tty/serial/qcom_geni_serial.c
drivers/tty/serial/rda-uart.c
drivers/tty/serial/rp2.c
drivers/tty/serial/sa1100.c
drivers/tty/serial/samsung_tty.c
drivers/tty/serial/sb1250-duart.c
drivers/tty/serial/sc16is7xx.c
drivers/tty/serial/sccnxp.c
drivers/tty/serial/serial-tegra.c
drivers/tty/serial/serial_core.c
drivers/tty/serial/serial_txx9.c
drivers/tty/serial/sh-sci.c
drivers/tty/serial/sifive.c
drivers/tty/serial/sprd_serial.c
drivers/tty/serial/st-asc.c
drivers/tty/serial/stm32-usart.c
drivers/tty/serial/sunhv.c
drivers/tty/serial/sunplus-uart.c
drivers/tty/serial/sunsab.c
drivers/tty/serial/sunsu.c
drivers/tty/serial/sunzilog.c
drivers/tty/serial/tegra-tcu.c
drivers/tty/serial/timbuart.c
drivers/tty/serial/uartlite.c
drivers/tty/serial/ucc_uart.c
drivers/tty/serial/vt8500_serial.c
drivers/tty/serial/xilinx_uartps.c
drivers/tty/serial/zs.c
drivers/tty/tty_ioctl.c
include/linux/serial_8250.h
include/linux/serial_core.h

index 7520cc0..2f17bf4 100644 (file)
@@ -243,7 +243,7 @@ static void serial21285_shutdown(struct uart_port *port)
 
 static void
 serial21285_set_termios(struct uart_port *port, struct ktermios *termios,
-                       struct ktermios *old)
+                       const struct ktermios *old)
 {
        unsigned long flags;
        unsigned int baud, quot, h_lcr, b;
index 8efdc27..fa8ccf2 100644 (file)
@@ -755,7 +755,7 @@ static void set_clock_mux(struct uart_port *up, struct brcmuart_priv *priv,
 
 static void brcmstb_set_termios(struct uart_port *up,
                                struct ktermios *termios,
-                               struct ktermios *old)
+                               const struct ktermios *old)
 {
        struct uart_8250_port *p8250 = up_to_u8250p(up);
        struct brcmuart_priv *priv = up->private_data;
index a604b42..7db5178 100644 (file)
@@ -350,7 +350,7 @@ dw8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old)
 }
 
 static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
-                              struct ktermios *old)
+                              const struct ktermios *old)
 {
        unsigned long newrate = tty_termios_baud_rate(termios) * 16;
        struct dw8250_data *d = to_dw8250_data(p->private_data);
index dbe4d44..75f32f0 100644 (file)
@@ -92,7 +92,8 @@ static void dw8250_set_divisor(struct uart_port *p, unsigned int baud,
        serial8250_do_set_divisor(p, baud, quot, quot_frac);
 }
 
-void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, struct ktermios *old)
+void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios,
+                          const struct ktermios *old)
 {
        p->status &= ~UPSTAT_AUTOCTS;
        if (termios->c_cflag & CRTSCTS)
index 055bfdc..f13e91f 100644 (file)
@@ -47,7 +47,7 @@ struct dw8250_data {
        unsigned int            uart_16550_compatible:1;
 };
 
-void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, struct ktermios *old);
+void dw8250_do_set_termios(struct uart_port *p, struct ktermios *termios, const struct ktermios *old);
 void dw8250_setup_port(struct uart_port *p);
 
 static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
index 65b6b3c..e2aa2a1 100644 (file)
@@ -278,7 +278,7 @@ static void fintek_8250_set_max_fifo(struct fintek_8250 *pdata)
 
 static void fintek_8250_set_termios(struct uart_port *port,
                                    struct ktermios *termios,
-                                   struct ktermios *old)
+                                   const struct ktermios *old)
 {
        struct fintek_8250 *pdata = port->private_data;
        unsigned int baud = tty_termios_baud_rate(termios);
index 4ba43be..44cc755 100644 (file)
@@ -70,7 +70,7 @@ static inline struct lpss8250 *to_lpss8250(struct dw8250_port_data *data)
 }
 
 static void byt_set_termios(struct uart_port *p, struct ktermios *termios,
-                           struct ktermios *old)
+                           const struct ktermios *old)
 {
        unsigned int baud = tty_termios_baud_rate(termios);
        struct lpss8250 *lpss = to_lpss8250(p->private_data);
index a2a03ac..2cc78a4 100644 (file)
@@ -206,9 +206,8 @@ static void dnv_exit(struct mid8250 *mid)
 
 /*****************************************************************************/
 
-static void mid8250_set_termios(struct uart_port *p,
-                               struct ktermios *termios,
-                               struct ktermios *old)
+static void mid8250_set_termios(struct uart_port *p, struct ktermios *termios,
+                               const struct ktermios *old)
 {
        unsigned int baud = tty_termios_baud_rate(termios);
        struct mid8250 *mid = p->private_data;
index 54051ec..fb1d5ec 100644 (file)
@@ -291,7 +291,7 @@ static void mtk8250_set_flow_ctrl(struct uart_8250_port *up, int mode)
 
 static void
 mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
-                       struct ktermios *old)
+                   const struct ktermios *old)
 {
        static const unsigned short fraction_L_mapping[] = {
                0, 1, 0x5, 0x15, 0x55, 0x57, 0x57, 0x77, 0x7F, 0xFF, 0xFF
index 0dcecbb..b43894e 100644 (file)
@@ -350,7 +350,7 @@ static void omap8250_restore_regs(struct uart_8250_port *up)
  */
 static void omap_8250_set_termios(struct uart_port *port,
                                  struct ktermios *termios,
-                                 struct ktermios *old)
+                                 const struct ktermios *old)
 {
        struct uart_8250_port *up = up_to_u8250p(port);
        struct omap8250_priv *priv = up->port.private_data;
index 25e4761..907c5ff 100644 (file)
@@ -2653,7 +2653,7 @@ static void serial8250_set_divisor(struct uart_port *port, unsigned int baud,
 
 static unsigned int serial8250_get_baud_rate(struct uart_port *port,
                                             struct ktermios *termios,
-                                            struct ktermios *old)
+                                            const struct ktermios *old)
 {
        unsigned int tolerance = port->uartclk / 100;
        unsigned int min;
@@ -2739,7 +2739,7 @@ EXPORT_SYMBOL_GPL(serial8250_update_uartclk);
 
 void
 serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
-                         struct ktermios *old)
+                         const struct ktermios *old)
 {
        struct uart_8250_port *up = up_to_u8250p(port);
        unsigned char cval;
@@ -2877,7 +2877,7 @@ EXPORT_SYMBOL(serial8250_do_set_termios);
 
 static void
 serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
-                      struct ktermios *old)
+                      const struct ktermios *old)
 {
        if (port->set_termios)
                port->set_termios(port, termios, old);
index cb791c5..23f3397 100644 (file)
@@ -106,8 +106,8 @@ static void altera_jtaguart_break_ctl(struct uart_port *port, int break_state)
 }
 
 static void altera_jtaguart_set_termios(struct uart_port *port,
-                                       struct ktermios *termios,
-                                       struct ktermios *old)
+                                       struct ktermios *termios,
+                                       const struct ktermios *old)
 {
        /* Just copy the old termios settings back */
        if (old)
index 8b749ed..a38db2c 100644 (file)
@@ -175,7 +175,7 @@ static void altera_uart_break_ctl(struct uart_port *port, int break_state)
 
 static void altera_uart_set_termios(struct uart_port *port,
                                    struct ktermios *termios,
-                                   struct ktermios *old)
+                                   const struct ktermios *old)
 {
        unsigned long flags;
        unsigned int baud, baudclk;
index fae0b58..af27fb8 100644 (file)
@@ -370,7 +370,7 @@ static void pl010_shutdown(struct uart_port *port)
 
 static void
 pl010_set_termios(struct uart_port *port, struct ktermios *termios,
-                    struct ktermios *old)
+                 const struct ktermios *old)
 {
        unsigned int lcr_h, old_cr;
        unsigned long flags;
index 033bf86..5cdced3 100644 (file)
@@ -2030,7 +2030,7 @@ pl011_setup_status_masks(struct uart_port *port, struct ktermios *termios)
 
 static void
 pl011_set_termios(struct uart_port *port, struct ktermios *termios,
-                    struct ktermios *old)
+                 const struct ktermios *old)
 {
        struct uart_amba_port *uap =
            container_of(port, struct uart_amba_port, port);
@@ -2162,7 +2162,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
 
 static void
 sbsa_uart_set_termios(struct uart_port *port, struct ktermios *termios,
-                     struct ktermios *old)
+                     const struct ktermios *old)
 {
        struct uart_amba_port *uap =
            container_of(port, struct uart_amba_port, port);
index 9ef82d8..450f4ed 100644 (file)
@@ -228,7 +228,7 @@ static void apbuart_shutdown(struct uart_port *port)
 }
 
 static void apbuart_set_termios(struct uart_port *port,
-                               struct ktermios *termios, struct ktermios *old)
+                               struct ktermios *termios, const struct ktermios *old)
 {
        unsigned int cr;
        unsigned long flags;
index 32caeac..0a4020d 100644 (file)
@@ -283,7 +283,7 @@ static void ar933x_uart_get_scale_step(unsigned int clk,
 
 static void ar933x_uart_set_termios(struct uart_port *port,
                                    struct ktermios *new,
-                                   struct ktermios *old)
+                                   const struct ktermios *old)
 {
        struct ar933x_uart_port *up =
                container_of(port, struct ar933x_uart_port, port);
index 2a09e92..2a65ea2 100644 (file)
@@ -351,7 +351,7 @@ static void arc_serial_shutdown(struct uart_port *port)
 
 static void
 arc_serial_set_termios(struct uart_port *port, struct ktermios *new,
-                      struct ktermios *old)
+                      const struct ktermios *old)
 {
        struct arc_uart_port *uart = to_arc_port(port);
        unsigned int baud, uartl, uarth, hw_val;
index 30ba9ee..a85169a 100644 (file)
@@ -2124,8 +2124,9 @@ static void atmel_serial_pm(struct uart_port *port, unsigned int state,
 /*
  * Change the port parameters
  */
-static void atmel_set_termios(struct uart_port *port, struct ktermios *termios,
-                             struct ktermios *old)
+static void atmel_set_termios(struct uart_port *port,
+                             struct ktermios *termios,
+                             const struct ktermios *old)
 {
        struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
        unsigned long flags;
index 53b4317..5d9737c 100644 (file)
@@ -492,9 +492,8 @@ static void bcm_uart_shutdown(struct uart_port *port)
 /*
  * serial core request to change current uart setting
  */
-static void bcm_uart_set_termios(struct uart_port *port,
-                                struct ktermios *new,
-                                struct ktermios *old)
+static void bcm_uart_set_termios(struct uart_port *port, struct ktermios *new,
+                                const struct ktermios *old)
 {
        unsigned int ctl, baud, quot, ier;
        unsigned long flags;
index b9b66ad..404b43a 100644 (file)
@@ -251,7 +251,7 @@ static void uart_clps711x_shutdown(struct uart_port *port)
 
 static void uart_clps711x_set_termios(struct uart_port *port,
                                      struct ktermios *termios,
-                                     struct ktermios *old)
+                                     const struct ktermios *old)
 {
        u32 ubrlcr;
        unsigned int baud, quot;
index db07d6a..a4713cb 100644 (file)
@@ -484,7 +484,7 @@ static void cpm_uart_shutdown(struct uart_port *port)
 
 static void cpm_uart_set_termios(struct uart_port *port,
                                  struct ktermios *termios,
-                                 struct ktermios *old)
+                                 const struct ktermios *old)
 {
        int baud;
        unsigned long flags;
index af951e6..0c0a623 100644 (file)
@@ -287,7 +287,7 @@ static void digicolor_uart_shutdown(struct uart_port *port)
 
 static void digicolor_uart_set_termios(struct uart_port *port,
                                       struct ktermios *termios,
-                                      struct ktermios *old)
+                                      const struct ktermios *old)
 {
        unsigned int baud, divisor;
        u8 config = 0;
index 3eaf4e8..829b452 100644 (file)
@@ -559,7 +559,7 @@ static void dz_reset(struct dz_port *dport)
 }
 
 static void dz_set_termios(struct uart_port *uport, struct ktermios *termios,
-                          struct ktermios *old_termios)
+                          const struct ktermios *old_termios)
 {
        struct dz_port *dport = to_dport(uport);
        unsigned long flags;
index 98bb0c3..84e8153 100644 (file)
@@ -401,7 +401,7 @@ static void linflex_shutdown(struct uart_port *port)
 
 static void
 linflex_set_termios(struct uart_port *port, struct ktermios *termios,
-                   struct ktermios *old)
+                   const struct ktermios *old)
 {
        unsigned long flags;
        unsigned long cr, old_cr, cr1;
index 4523a77..3684fcf 100644 (file)
@@ -1833,7 +1833,7 @@ static void lpuart32_shutdown(struct uart_port *port)
 
 static void
 lpuart_set_termios(struct uart_port *port, struct ktermios *termios,
-                  struct ktermios *old)
+                  const struct ktermios *old)
 {
        struct lpuart_port *sport = container_of(port, struct lpuart_port, port);
        unsigned long flags;
@@ -2073,7 +2073,7 @@ static void lpuart32_serial_setbrg(struct lpuart_port *sport,
 
 static void
 lpuart32_set_termios(struct uart_port *port, struct ktermios *termios,
-                  struct ktermios *old)
+                    const struct ktermios *old)
 {
        struct lpuart_port *sport = container_of(port, struct lpuart_port, port);
        unsigned long flags;
index 45df299..819f957 100644 (file)
@@ -1351,9 +1351,8 @@ static void icom_close(struct uart_port *port)
        kref_put(&icom_port->adapter->kref, icom_kref_release);
 }
 
-static void icom_set_termios(struct uart_port *port,
-                            struct ktermios *termios,
-                            struct ktermios *old_termios)
+static void icom_set_termios(struct uart_port *port, struct ktermios *termios,
+                            const struct ktermios *old_termios)
 {
        struct icom_port *icom_port = to_icom_port(port);
        int baud;
index 522445a..5875ee6 100644 (file)
@@ -1620,7 +1620,7 @@ static void imx_uart_flush_buffer(struct uart_port *port)
 
 static void
 imx_uart_set_termios(struct uart_port *port, struct ktermios *termios,
-                    struct ktermios *old)
+                    const struct ktermios *old)
 {
        struct imx_port *sport = (struct imx_port *)port;
        unsigned long flags;
index 655e64b..dd0a891 100644 (file)
@@ -873,7 +873,7 @@ ip22zilog_convert_to_zs(struct uart_ip22zilog_port *up, unsigned int cflag,
 /* The port lock is not held.  */
 static void
 ip22zilog_set_termios(struct uart_port *port, struct ktermios *termios,
-                     struct ktermios *old)
+                     const struct ktermios *old)
 {
        struct uart_ip22zilog_port *up =
                container_of(port, struct uart_ip22zilog_port, port);
index cb58bde..222afc2 100644 (file)
@@ -300,8 +300,8 @@ static void jsm_tty_close(struct uart_port *port)
 }
 
 static void jsm_tty_set_termios(struct uart_port *port,
-                                struct ktermios *termios,
-                                struct ktermios *old_termios)
+                               struct ktermios *termios,
+                               const struct ktermios *old_termios)
 {
        unsigned long lock_flags;
        struct jsm_channel *channel =
index a3120c3..6637b3c 100644 (file)
@@ -405,8 +405,8 @@ lqasc_shutdown(struct uart_port *port)
 }
 
 static void
-lqasc_set_termios(struct uart_port *port,
-       struct ktermios *new, struct ktermios *old)
+lqasc_set_termios(struct uart_port *port, struct ktermios *new,
+                 const struct ktermios *old)
 {
        unsigned int cflag;
        unsigned int iflag;
index 328b505..4c06043 100644 (file)
@@ -178,7 +178,7 @@ static void liteuart_shutdown(struct uart_port *port)
 }
 
 static void liteuart_set_termios(struct uart_port *port, struct ktermios *new,
-                                struct ktermios *old)
+                                const struct ktermios *old)
 {
        unsigned int baud;
        unsigned long flags;
index 93140ca..0d5ef7d 100644 (file)
@@ -493,7 +493,7 @@ static void serial_lpc32xx_shutdown(struct uart_port *port)
 /* port->lock is not held.  */
 static void serial_lpc32xx_set_termios(struct uart_port *port,
                                       struct ktermios *termios,
-                                      struct ktermios *old)
+                                      const struct ktermios *old)
 {
        unsigned long flags;
        unsigned int baud, quot;
index 0b5f21f..c69602f 100644 (file)
@@ -418,7 +418,7 @@ static void max3100_set_mctrl(struct uart_port *port, unsigned int mctrl)
 
 static void
 max3100_set_termios(struct uart_port *port, struct ktermios *termios,
-                   struct ktermios *old)
+                   const struct ktermios *old)
 {
        struct max3100_port *s = container_of(port,
                                              struct max3100_port,
index ab10ca4..724049a 100644 (file)
@@ -906,7 +906,7 @@ static void max310x_break_ctl(struct uart_port *port, int break_state)
 
 static void max310x_set_termios(struct uart_port *port,
                                struct ktermios *termios,
-                               struct ktermios *old)
+                               const struct ktermios *old)
 {
        unsigned int lcr = 0, flow = 0;
        int baud;
index f4aaaad..b1cd9a7 100644 (file)
@@ -192,7 +192,7 @@ static void mcf_shutdown(struct uart_port *port)
 /****************************************************************************/
 
 static void mcf_set_termios(struct uart_port *port, struct ktermios *termios,
-       struct ktermios *old)
+                           const struct ktermios *old)
 {
        unsigned long flags;
        unsigned int baud, baudclk;
index 12117b5..3690f5c 100644 (file)
@@ -646,8 +646,8 @@ static void men_z135_shutdown(struct uart_port *port)
 }
 
 static void men_z135_set_termios(struct uart_port *port,
-                               struct ktermios *termios,
-                               struct ktermios *old)
+                                struct ktermios *termios,
+                                const struct ktermios *old)
 {
        struct men_z135_port *uart = to_men_z135(port);
        unsigned int baud;
index 26de08b..056243c 100644 (file)
@@ -335,7 +335,7 @@ static void meson_uart_change_speed(struct uart_port *port, unsigned long baud)
 
 static void meson_uart_set_termios(struct uart_port *port,
                                   struct ktermios *termios,
-                                  struct ktermios *old)
+                                  const struct ktermios *old)
 {
        unsigned int cflags, iflags, baud;
        unsigned long flags;
index 347088b..c15e0d8 100644 (file)
@@ -298,7 +298,8 @@ static void mlb_usio_shutdown(struct uart_port *port)
 }
 
 static void mlb_usio_set_termios(struct uart_port *port,
-                       struct ktermios *termios, struct ktermios *old)
+                                struct ktermios *termios,
+                                const struct ktermios *old)
 {
        unsigned int escr, smr = MLB_USIO_SMR_SOE;
        unsigned long flags, baud, quot;
index 3f1986c..6f09b1c 100644 (file)
@@ -101,7 +101,7 @@ struct psc_ops {
        void            (*cw_restore_ints)(struct uart_port *port);
        unsigned int    (*set_baudrate)(struct uart_port *port,
                                        struct ktermios *new,
-                                       struct ktermios *old);
+                                       const struct ktermios *old);
        int             (*clock_alloc)(struct uart_port *port);
        void            (*clock_relse)(struct uart_port *port);
        int             (*clock)(struct uart_port *port, int enable);
@@ -287,7 +287,7 @@ static void mpc52xx_psc_cw_restore_ints(struct uart_port *port)
 
 static unsigned int mpc5200_psc_set_baudrate(struct uart_port *port,
                                             struct ktermios *new,
-                                            struct ktermios *old)
+                                            const struct ktermios *old)
 {
        unsigned int baud;
        unsigned int divisor;
@@ -305,7 +305,7 @@ static unsigned int mpc5200_psc_set_baudrate(struct uart_port *port,
 
 static unsigned int mpc5200b_psc_set_baudrate(struct uart_port *port,
                                              struct ktermios *new,
-                                             struct ktermios *old)
+                                             const struct ktermios *old)
 {
        unsigned int baud;
        unsigned int divisor;
@@ -533,7 +533,7 @@ static void mpc512x_psc_cw_restore_ints(struct uart_port *port)
 
 static unsigned int mpc512x_psc_set_baudrate(struct uart_port *port,
                                             struct ktermios *new,
-                                            struct ktermios *old)
+                                            const struct ktermios *old)
 {
        unsigned int baud;
        unsigned int divisor;
@@ -880,7 +880,7 @@ static inline void mpc5125_set_divisor(struct mpc5125_psc __iomem *psc,
 
 static unsigned int mpc5125_psc_set_baudrate(struct uart_port *port,
                                             struct ktermios *new,
-                                            struct ktermios *old)
+                                            const struct ktermios *old)
 {
        unsigned int baud;
        unsigned int divisor;
@@ -1167,7 +1167,7 @@ mpc52xx_uart_shutdown(struct uart_port *port)
 
 static void
 mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
-                        struct ktermios *old)
+                        const struct ktermios *old)
 {
        unsigned long flags;
        unsigned char mr1, mr2;
index 5e9429d..2e3e6cf 100644 (file)
@@ -358,7 +358,7 @@ static void mps2_uart_shutdown(struct uart_port *port)
 
 static void
 mps2_uart_set_termios(struct uart_port *port, struct ktermios *termios,
-                     struct ktermios *old)
+                     const struct ktermios *old)
 {
        unsigned long flags;
        unsigned int baud, bauddiv;
index 3159889..7dd19a2 100644 (file)
@@ -1263,7 +1263,7 @@ static void msm_shutdown(struct uart_port *port)
 }
 
 static void msm_set_termios(struct uart_port *port, struct ktermios *termios,
-                           struct ktermios *old)
+                           const struct ktermios *old)
 {
        struct msm_port *msm_port = to_msm_port(port);
        struct msm_dma *dma = &msm_port->rx_dma;
index 0ba0f4d..ed0e763 100644 (file)
@@ -289,7 +289,7 @@ static void mux_shutdown(struct uart_port *port)
  */
 static void
 mux_set_termios(struct uart_port *port, struct ktermios *termios,
-               struct ktermios *old)
+               const struct ktermios *old)
 {
 }
 
index 65eaecd..ba16e1d 100644 (file)
@@ -564,7 +564,7 @@ static unsigned int mvebu_uart_baud_rate_set(struct uart_port *port, unsigned in
 
 static void mvebu_uart_set_termios(struct uart_port *port,
                                   struct ktermios *termios,
-                                  struct ktermios *old)
+                                  const struct ktermios *old)
 {
        unsigned long flags;
        unsigned int baud, min_baud, max_baud;
index 1944daf..d21a4f3 100644 (file)
@@ -959,7 +959,7 @@ err_out:
 #define CTS_AT_AUART() !mctrl_gpio_to_gpiod(s->gpios, UART_GPIO_CTS)
 static void mxs_auart_settermios(struct uart_port *u,
                                 struct ktermios *termios,
-                                struct ktermios *old)
+                                const struct ktermios *old)
 {
        struct mxs_auart_port *s = to_auart_port(u);
        u32 ctrl, ctrl2, div;
index 0aa666e..c87d85b 100644 (file)
@@ -802,7 +802,7 @@ static void serial_omap_uart_qos_work(struct work_struct *work)
 
 static void
 serial_omap_set_termios(struct uart_port *port, struct ktermios *termios,
-                       struct ktermios *old)
+                       const struct ktermios *old)
 {
        struct uart_omap_port *up = to_uart_omap_port(port);
        unsigned char cval = 0;
index 888e17e..fde39cc 100644 (file)
@@ -328,7 +328,7 @@ static void owl_uart_change_baudrate(struct owl_uart_port *owl_port,
 
 static void owl_uart_set_termios(struct uart_port *port,
                                 struct ktermios *termios,
-                                struct ktermios *old)
+                                const struct ktermios *old)
 {
        struct owl_uart_port *owl_port = to_owl_uart_port(port);
        unsigned int baud;
index 8a9065e..11ba5df 100644 (file)
@@ -1301,7 +1301,8 @@ static void pch_uart_shutdown(struct uart_port *port)
  *bits.  Update read_status_mask and ignore_status_mask to indicate
  *the types of events we are interested in receiving.  */
 static void pch_uart_set_termios(struct uart_port *port,
-                                struct ktermios *termios, struct ktermios *old)
+                                struct ktermios *termios,
+                                const struct ktermios *old)
 {
        int rtn;
        unsigned int baud, parity, bits, stb;
index 56516a7..2beada6 100644 (file)
@@ -599,7 +599,7 @@ static void pic32_uart_shutdown(struct uart_port *port)
 /* serial core request to change current uart setting */
 static void pic32_uart_set_termios(struct uart_port *port,
                                   struct ktermios *new,
-                                  struct ktermios *old)
+                                  const struct ktermios *old)
 {
        struct pic32_sport *sport = to_pic32_sport(port);
        unsigned int baud;
index f63257b..fe2e4ec 100644 (file)
@@ -1202,7 +1202,7 @@ static void pmz_irda_setup(struct uart_pmac_port *uap, unsigned long *baud)
 
 
 static void __pmz_set_termios(struct uart_port *port, struct ktermios *termios,
-                             struct ktermios *old)
+                             const struct ktermios *old)
 {
        struct uart_pmac_port *uap = to_pmz(port);
        unsigned long baud;
@@ -1244,7 +1244,7 @@ static void __pmz_set_termios(struct uart_port *port, struct ktermios *termios,
 
 /* The port lock is not held.  */
 static void pmz_set_termios(struct uart_port *port, struct ktermios *termios,
-                           struct ktermios *old)
+                           const struct ktermios *old)
 {
        struct uart_pmac_port *uap = to_pmz(port);
        unsigned long flags;
index 9309ffd..2d25231 100644 (file)
@@ -423,7 +423,7 @@ static void serial_pxa_shutdown(struct uart_port *port)
 
 static void
 serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
-                      struct ktermios *old)
+                      const struct ktermios *old)
 {
        struct uart_pxa_port *up = (struct uart_pxa_port *)port;
        unsigned char cval, fcr = 0;
index f4698a0..52182f6 100644 (file)
@@ -1005,7 +1005,8 @@ static unsigned long get_clk_div_rate(struct clk *clk, unsigned int baud,
 }
 
 static void qcom_geni_serial_set_termios(struct uart_port *uport,
-                               struct ktermios *termios, struct ktermios *old)
+                                        struct ktermios *termios,
+                                        const struct ktermios *old)
 {
        unsigned int baud;
        u32 bits_per_char;
index feb2054..0e387e2 100644 (file)
@@ -238,7 +238,7 @@ static void rda_uart_change_baudrate(struct rda_uart_port *rda_port,
 
 static void rda_uart_set_termios(struct uart_port *port,
                                 struct ktermios *termios,
-                                struct ktermios *old)
+                                const struct ktermios *old)
 {
        struct rda_uart_port *rda_port = to_rda_uart_port(port);
        unsigned long flags;
index 6689d8a..b81afb0 100644 (file)
@@ -370,9 +370,8 @@ static void __rp2_uart_set_termios(struct rp2_uart_port *up,
               up->ucode + RP2_RX_SWFLOW);
 }
 
-static void rp2_uart_set_termios(struct uart_port *port,
-                                struct ktermios *new,
-                                struct ktermios *old)
+static void rp2_uart_set_termios(struct uart_port *port, struct ktermios *new,
+                                const struct ktermios *old)
 {
        struct rp2_uart_port *up = port_to_up(port);
        unsigned long flags;
index e64e42a..dd9e325 100644 (file)
@@ -409,7 +409,7 @@ static void sa1100_shutdown(struct uart_port *port)
 
 static void
 sa1100_set_termios(struct uart_port *port, struct ktermios *termios,
-                  struct ktermios *old)
+                  const struct ktermios *old)
 {
        struct sa1100_port *sport =
                container_of(port, struct sa1100_port, port);
index b7a4b47..77d1363 100644 (file)
@@ -1530,7 +1530,7 @@ static const u16 udivslot_table[16] = {
 
 static void s3c24xx_serial_set_termios(struct uart_port *port,
                                       struct ktermios *termios,
-                                      struct ktermios *old)
+                                      const struct ktermios *old)
 {
        const struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port);
        struct s3c24xx_uart_port *ourport = to_ourport(port);
index 2cf8533..c5d2b6c 100644 (file)
@@ -531,7 +531,7 @@ static void sbd_init_port(struct sbd_port *sport)
 }
 
 static void sbd_set_termios(struct uart_port *uport, struct ktermios *termios,
-                           struct ktermios *old_termios)
+                           const struct ktermios *old_termios)
 {
        struct sbd_port *sport = to_sport(uport);
        unsigned int mode1 = 0, mode2 = 0, aux = 0;
index 259e08c..5ecf8f9 100644 (file)
@@ -1015,7 +1015,7 @@ static void sc16is7xx_break_ctl(struct uart_port *port, int break_state)
 
 static void sc16is7xx_set_termios(struct uart_port *port,
                                  struct ktermios *termios,
-                                 struct ktermios *old)
+                                 const struct ktermios *old)
 {
        struct sc16is7xx_port *s = dev_get_drvdata(port->dev);
        struct sc16is7xx_one *one = to_sc16is7xx_one(port, port);
index c56de2e..dd98509 100644 (file)
@@ -636,7 +636,8 @@ static void sccnxp_break_ctl(struct uart_port *port, int break_state)
 }
 
 static void sccnxp_set_termios(struct uart_port *port,
-                              struct ktermios *termios, struct ktermios *old)
+                              struct ktermios *termios,
+                              const struct ktermios *old)
 {
        struct sccnxp_port *s = dev_get_drvdata(port->dev);
        unsigned long flags;
index ad4f356..da2993f 100644 (file)
@@ -1271,7 +1271,8 @@ static void tegra_uart_enable_ms(struct uart_port *u)
 }
 
 static void tegra_uart_set_termios(struct uart_port *u,
-               struct ktermios *termios, struct ktermios *oldtermios)
+                                  struct ktermios *termios,
+                                  const struct ktermios *oldtermios)
 {
        struct tegra_uart_port *tup = to_tegra_uport(u);
        unsigned int baud;
index 3561a16..04c0bb1 100644 (file)
@@ -380,7 +380,7 @@ EXPORT_SYMBOL(uart_update_timeout);
  */
 unsigned int
 uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
-                  struct ktermios *old, unsigned int min, unsigned int max)
+                  const struct ktermios *old, unsigned int min, unsigned int max)
 {
        unsigned int try;
        unsigned int baud;
index 228e380..e12f1dc 100644 (file)
@@ -594,7 +594,7 @@ static void serial_txx9_shutdown(struct uart_port *up)
 
 static void
 serial_txx9_set_termios(struct uart_port *up, struct ktermios *termios,
-                      struct ktermios *old)
+                       const struct ktermios *old)
 {
        unsigned int cval, fcr = 0;
        unsigned long flags;
index 0075a14..9ad3663 100644 (file)
@@ -2367,7 +2367,7 @@ static void sci_reset(struct uart_port *port)
 }
 
 static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
-                           struct ktermios *old)
+                           const struct ktermios *old)
 {
        unsigned int baud, smr_val = SCSMR_ASYNC, scr_val = 0, i, bits;
        unsigned int brr = 255, cks = 0, srr = 15, dl = 0, sccks = 0;
index 5c3a075..4761f17 100644 (file)
@@ -646,7 +646,7 @@ static int sifive_serial_clk_notifier(struct notifier_block *nb,
 
 static void sifive_serial_set_termios(struct uart_port *port,
                                      struct ktermios *termios,
-                                     struct ktermios *old)
+                                     const struct ktermios *old)
 {
        struct sifive_serial_port *ssp = port_to_sifive_serial_port(port);
        unsigned long flags;
index 4329b9c..342a879 100644 (file)
@@ -771,9 +771,8 @@ static void sprd_shutdown(struct uart_port *port)
        devm_free_irq(port->dev, port->irq, port);
 }
 
-static void sprd_set_termios(struct uart_port *port,
-                            struct ktermios *termios,
-                            struct ktermios *old)
+static void sprd_set_termios(struct uart_port *port, struct ktermios *termios,
+                            const struct ktermios *old)
 {
        unsigned int baud, quot;
        unsigned int lcr = 0, fc;
index cce42f4..fcecea6 100644 (file)
@@ -500,7 +500,7 @@ static void asc_pm(struct uart_port *port, unsigned int state,
 }
 
 static void asc_set_termios(struct uart_port *port, struct ktermios *termios,
-                           struct ktermios *old)
+                           const struct ktermios *old)
 {
        struct asc_port *ascport = to_asc_port(port);
        struct gpio_desc *gpiod;
index 2c85dbf..0b18615 100644 (file)
@@ -1089,7 +1089,7 @@ static void stm32_usart_shutdown(struct uart_port *port)
 
 static void stm32_usart_set_termios(struct uart_port *port,
                                    struct ktermios *termios,
-                                   struct ktermios *old)
+                                   const struct ktermios *old)
 {
        struct stm32_port *stm32_port = to_stm32_port(port);
        const struct stm32_usart_offsets *ofs = &stm32_port->info->ofs;
index eafada8..1938ba5 100644 (file)
@@ -323,7 +323,7 @@ static void sunhv_shutdown(struct uart_port *port)
 
 /* port->lock is not held.  */
 static void sunhv_set_termios(struct uart_port *port, struct ktermios *termios,
-                             struct ktermios *old)
+                             const struct ktermios *old)
 {
        unsigned int baud = uart_get_baud_rate(port, termios, old, 0, 4000000);
        unsigned int quot = uart_get_divisor(port, baud);
index 60c7366..7afe61a 100644 (file)
@@ -333,7 +333,7 @@ static void sunplus_shutdown(struct uart_port *port)
 
 static void sunplus_set_termios(struct uart_port *port,
                                struct ktermios *termios,
-                               struct ktermios *oldtermios)
+                               const struct ktermios *oldtermios)
 {
        u32 ext, div, div_l, div_h, baud, lcr;
        u32 clk = port->uartclk;
index 6ea5229..b549822 100644 (file)
@@ -776,7 +776,7 @@ static void sunsab_convert_to_sab(struct uart_sunsab_port *up, unsigned int cfla
 
 /* port->lock is not held.  */
 static void sunsab_set_termios(struct uart_port *port, struct ktermios *termios,
-                              struct ktermios *old)
+                              const struct ktermios *old)
 {
        struct uart_sunsab_port *up =
                container_of(port, struct uart_sunsab_port, port);
index d5dcb61..9ea7e56 100644 (file)
@@ -897,7 +897,7 @@ sunsu_change_speed(struct uart_port *port, unsigned int cflag,
 
 static void
 sunsu_set_termios(struct uart_port *port, struct ktermios *termios,
-                 struct ktermios *old)
+                 const struct ktermios *old)
 {
        unsigned int baud, quot;
 
index c44cf61..8742529 100644 (file)
@@ -938,7 +938,7 @@ sunzilog_convert_to_zs(struct uart_sunzilog_port *up, unsigned int cflag,
 /* The port lock is not held.  */
 static void
 sunzilog_set_termios(struct uart_port *port, struct ktermios *termios,
-                    struct ktermios *old)
+                    const struct ktermios *old)
 {
        struct uart_sunzilog_port *up =
                container_of(port, struct uart_sunzilog_port, port);
index 4877c54..366dc94 100644 (file)
@@ -126,7 +126,7 @@ static void tegra_tcu_uart_shutdown(struct uart_port *port)
 
 static void tegra_tcu_uart_set_termios(struct uart_port *port,
                                       struct ktermios *new,
-                                      struct ktermios *old)
+                                      const struct ktermios *old)
 {
 }
 
index 08941ea..bb19ed0 100644 (file)
@@ -275,8 +275,8 @@ static int get_bindex(int baud)
 }
 
 static void timbuart_set_termios(struct uart_port *port,
-       struct ktermios *termios,
-       struct ktermios *old)
+                                struct ktermios *termios,
+                                const struct ktermios *old)
 {
        unsigned int baud;
        short bindex;
index 880e2af..eca41ac 100644 (file)
@@ -314,8 +314,9 @@ static void ulite_shutdown(struct uart_port *port)
        clk_disable(pdata->clk);
 }
 
-static void ulite_set_termios(struct uart_port *port, struct ktermios *termios,
-                             struct ktermios *old)
+static void ulite_set_termios(struct uart_port *port,
+                             struct ktermios *termios,
+                             const struct ktermios *old)
 {
        unsigned long flags;
        struct uartlite_data *pdata = port->private_data;
index 3cc9ef0..0c7768b 100644 (file)
@@ -843,7 +843,8 @@ static void qe_uart_shutdown(struct uart_port *port)
  * Set the serial port parameters.
  */
 static void qe_uart_set_termios(struct uart_port *port,
-                               struct ktermios *termios, struct ktermios *old)
+                               struct ktermios *termios,
+                               const struct ktermios *old)
 {
        struct uart_qe_port *qe_port =
                container_of(port, struct uart_qe_port, port);
index 6f08136..508ad7a 100644 (file)
@@ -355,7 +355,7 @@ static void vt8500_shutdown(struct uart_port *port)
 
 static void vt8500_set_termios(struct uart_port *port,
                               struct ktermios *termios,
-                              struct ktermios *old)
+                              const struct ktermios *old)
 {
        struct vt8500_port *vt8500_port =
                        container_of(port, struct vt8500_port, uart);
index 606429b..2eff7cf 100644 (file)
@@ -677,7 +677,8 @@ static void cdns_uart_break_ctl(struct uart_port *port, int ctl)
  * @old: Values of the previously saved termios structure
  */
 static void cdns_uart_set_termios(struct uart_port *port,
-                               struct ktermios *termios, struct ktermios *old)
+                                 struct ktermios *termios,
+                                 const struct ktermios *old)
 {
        u32 cval = 0;
        unsigned int baud, minbaud, maxbaud;
index 5bc5859..688db7d 100644 (file)
@@ -846,7 +846,7 @@ static void zs_reset(struct zs_port *zport)
 }
 
 static void zs_set_termios(struct uart_port *uport, struct ktermios *termios,
-                          struct ktermios *old_termios)
+                          const struct ktermios *old_termios)
 {
        struct zs_port *zport = to_zport(uport);
        struct zs_scc *scc = zport->scc;
index fc94988..31d1123 100644 (file)
@@ -219,7 +219,7 @@ EXPORT_SYMBOL(tty_wait_until_sent);
  *             Termios Helper Methods
  */
 
-static void unset_locked_termios(struct tty_struct *tty, struct ktermios *old)
+static void unset_locked_termios(struct tty_struct *tty, const struct ktermios *old)
 {
        struct ktermios *termios = &tty->termios;
        struct ktermios *locked  = &tty->termios_locked;
index 8c7b793..43edd10 100644 (file)
@@ -32,7 +32,7 @@ struct plat_serial8250_port {
        void            (*serial_out)(struct uart_port *, int, int);
        void            (*set_termios)(struct uart_port *,
                                       struct ktermios *new,
-                                      struct ktermios *old);
+                                      const struct ktermios *old);
        void            (*set_ldisc)(struct uart_port *,
                                     struct ktermios *);
        unsigned int    (*get_mctrl)(struct uart_port *);
@@ -157,7 +157,7 @@ extern int early_serial8250_setup(struct earlycon_device *device,
 extern void serial8250_update_uartclk(struct uart_port *port,
                                      unsigned int uartclk);
 extern void serial8250_do_set_termios(struct uart_port *port,
-               struct ktermios *termios, struct ktermios *old);
+               struct ktermios *termios, const struct ktermios *old);
 extern void serial8250_do_set_ldisc(struct uart_port *port,
                                    struct ktermios *termios);
 extern unsigned int serial8250_do_get_mctrl(struct uart_port *port);
index aef3145..0e9bc94 100644 (file)
@@ -379,7 +379,7 @@ struct uart_ops {
        void            (*shutdown)(struct uart_port *);
        void            (*flush_buffer)(struct uart_port *);
        void            (*set_termios)(struct uart_port *, struct ktermios *new,
-                                      struct ktermios *old);
+                                      const struct ktermios *old);
        void            (*set_ldisc)(struct uart_port *, struct ktermios *);
        void            (*pm)(struct uart_port *, unsigned int state,
                              unsigned int oldstate);
@@ -425,7 +425,7 @@ struct uart_port {
        void                    (*serial_out)(struct uart_port *, int, int);
        void                    (*set_termios)(struct uart_port *,
                                               struct ktermios *new,
-                                              struct ktermios *old);
+                                              const struct ktermios *old);
        void                    (*set_ldisc)(struct uart_port *,
                                             struct ktermios *);
        unsigned int            (*get_mctrl)(struct uart_port *);
@@ -644,7 +644,7 @@ void uart_write_wakeup(struct uart_port *port);
 void uart_update_timeout(struct uart_port *port, unsigned int cflag,
                         unsigned int baud);
 unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
-                               struct ktermios *old, unsigned int min,
+                               const struct ktermios *old, unsigned int min,
                                unsigned int max);
 unsigned int uart_get_divisor(struct uart_port *port, unsigned int baud);