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

serial-uartlite: Constify uartlite_be/uartlite_le

Made uartlite_be and uartlite_le constants.

Signed-off-by: Maarten Brock <m.brock@vanmierlo.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Maarten Brock and committed by
Greg Kroah-Hartman
973ea59e 1681d211

+6 -6
+6 -6
drivers/tty/serial/uartlite.c
··· 72 72 iowrite32be(val, addr); 73 73 } 74 74 75 - static struct uartlite_reg_ops uartlite_be = { 75 + static const struct uartlite_reg_ops uartlite_be = { 76 76 .in = uartlite_inbe32, 77 77 .out = uartlite_outbe32, 78 78 }; ··· 87 87 iowrite32(val, addr); 88 88 } 89 89 90 - static struct uartlite_reg_ops uartlite_le = { 90 + static const struct uartlite_reg_ops uartlite_le = { 91 91 .in = uartlite_inle32, 92 92 .out = uartlite_outle32, 93 93 }; 94 94 95 95 static inline u32 uart_in32(u32 offset, struct uart_port *port) 96 96 { 97 - struct uartlite_reg_ops *reg_ops = port->private_data; 97 + const struct uartlite_reg_ops *reg_ops = port->private_data; 98 98 99 99 return reg_ops->in(port->membase + offset); 100 100 } 101 101 102 102 static inline void uart_out32(u32 val, u32 offset, struct uart_port *port) 103 103 { 104 - struct uartlite_reg_ops *reg_ops = port->private_data; 104 + const struct uartlite_reg_ops *reg_ops = port->private_data; 105 105 106 106 reg_ops->out(val, port->membase + offset); 107 107 } ··· 345 345 return -EBUSY; 346 346 } 347 347 348 - port->private_data = &uartlite_be; 348 + port->private_data = (void *)&uartlite_be; 349 349 ret = uart_in32(ULITE_CONTROL, port); 350 350 uart_out32(ULITE_CONTROL_RST_TX, ULITE_CONTROL, port); 351 351 ret = uart_in32(ULITE_STATUS, port); 352 352 /* Endianess detection */ 353 353 if ((ret & ULITE_STATUS_TXEMPTY) != ULITE_STATUS_TXEMPTY) 354 - port->private_data = &uartlite_le; 354 + port->private_data = (void *)&uartlite_le; 355 355 356 356 return 0; 357 357 }