[SERIAL] Make port->ops constant
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sat, 21 Jan 2006 22:45:50 +0000 (22:45 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 21 Jan 2006 22:45:50 +0000 (22:45 +0000)
No one should write to the port->ops structure, so make it constant.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
drivers/serial/serial_core.c
include/linux/serial_core.h

index 943770470b9db316af2ed25cce1fca9296df43a2..74142b731527e755d0ec02d988485bdd3570a019 100644 (file)
@@ -1870,7 +1870,7 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
        mutex_lock(&state->mutex);
 
        if (state->info && state->info->flags & UIF_INITIALIZED) {
-               struct uart_ops *ops = port->ops;
+               const struct uart_ops *ops = port->ops;
 
                spin_lock_irq(&port->lock);
                ops->stop_tx(port);
@@ -1932,7 +1932,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
        }
 
        if (state->info && state->info->flags & UIF_INITIALIZED) {
-               struct uart_ops *ops = port->ops;
+               const struct uart_ops *ops = port->ops;
                int ret;
 
                ops->set_mctrl(port, 0);
index f3af47713a4e45489037ad7cff2c0b26423995b8..b74ff34469b99b4d3bde950c858c70d3fa06eb8c 100644 (file)
@@ -257,7 +257,7 @@ struct uart_port {
        unsigned int            mctrl;                  /* current modem ctrl settings */
        unsigned int            timeout;                /* character-based timeout */
        unsigned int            type;                   /* port type */
-       struct uart_ops         *ops;
+       const struct uart_ops   *ops;
        unsigned int            custom_divisor;
        unsigned int            line;                   /* port index */
        unsigned long           mapbase;                /* for ioremap */