diff options
Diffstat (limited to 'drivers/tty/serial')
| -rw-r--r-- | drivers/tty/serial/8250/8250_uniphier.c | 8 | ||||
| -rw-r--r-- | drivers/tty/serial/earlycon.c | 2 | ||||
| -rw-r--r-- | drivers/tty/serial/sh-sci.c | 2 | ||||
| -rw-r--r-- | drivers/tty/serial/sunhv.c | 12 |
4 files changed, 16 insertions, 8 deletions
diff --git a/drivers/tty/serial/8250/8250_uniphier.c b/drivers/tty/serial/8250/8250_uniphier.c index d11621e2cf1d..245edbb68d4b 100644 --- a/drivers/tty/serial/8250/8250_uniphier.c +++ b/drivers/tty/serial/8250/8250_uniphier.c | |||
| @@ -115,12 +115,16 @@ static void uniphier_serial_out(struct uart_port *p, int offset, int value) | |||
| 115 | */ | 115 | */ |
| 116 | static int uniphier_serial_dl_read(struct uart_8250_port *up) | 116 | static int uniphier_serial_dl_read(struct uart_8250_port *up) |
| 117 | { | 117 | { |
| 118 | return readl(up->port.membase + UNIPHIER_UART_DLR); | 118 | int offset = UNIPHIER_UART_DLR << up->port.regshift; |
| 119 | |||
| 120 | return readl(up->port.membase + offset); | ||
| 119 | } | 121 | } |
| 120 | 122 | ||
| 121 | static void uniphier_serial_dl_write(struct uart_8250_port *up, int value) | 123 | static void uniphier_serial_dl_write(struct uart_8250_port *up, int value) |
| 122 | { | 124 | { |
| 123 | writel(value, up->port.membase + UNIPHIER_UART_DLR); | 125 | int offset = UNIPHIER_UART_DLR << up->port.regshift; |
| 126 | |||
| 127 | writel(value, up->port.membase + offset); | ||
| 124 | } | 128 | } |
| 125 | 129 | ||
| 126 | static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port, | 130 | static int uniphier_of_serial_setup(struct device *dev, struct uart_port *port, |
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c index f09636083426..b5b2f2be6be7 100644 --- a/drivers/tty/serial/earlycon.c +++ b/drivers/tty/serial/earlycon.c | |||
| @@ -115,6 +115,7 @@ static int __init register_earlycon(char *buf, const struct earlycon_id *match) | |||
| 115 | if (buf && !parse_options(&early_console_dev, buf)) | 115 | if (buf && !parse_options(&early_console_dev, buf)) |
| 116 | buf = NULL; | 116 | buf = NULL; |
| 117 | 117 | ||
| 118 | spin_lock_init(&port->lock); | ||
| 118 | port->uartclk = BASE_BAUD * 16; | 119 | port->uartclk = BASE_BAUD * 16; |
| 119 | if (port->mapbase) | 120 | if (port->mapbase) |
| 120 | port->membase = earlycon_map(port->mapbase, 64); | 121 | port->membase = earlycon_map(port->mapbase, 64); |
| @@ -202,6 +203,7 @@ int __init of_setup_earlycon(unsigned long addr, | |||
| 202 | int err; | 203 | int err; |
| 203 | struct uart_port *port = &early_console_dev.port; | 204 | struct uart_port *port = &early_console_dev.port; |
| 204 | 205 | ||
| 206 | spin_lock_init(&port->lock); | ||
| 205 | port->iotype = UPIO_MEM; | 207 | port->iotype = UPIO_MEM; |
| 206 | port->mapbase = addr; | 208 | port->mapbase = addr; |
| 207 | port->uartclk = BASE_BAUD * 16; | 209 | port->uartclk = BASE_BAUD * 16; |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index 960e50a97558..51c7507b0444 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
| @@ -1437,7 +1437,7 @@ static void sci_request_dma(struct uart_port *port) | |||
| 1437 | sg_init_table(sg, 1); | 1437 | sg_init_table(sg, 1); |
| 1438 | s->rx_buf[i] = buf; | 1438 | s->rx_buf[i] = buf; |
| 1439 | sg_dma_address(sg) = dma; | 1439 | sg_dma_address(sg) = dma; |
| 1440 | sg->length = s->buf_len_rx; | 1440 | sg_dma_len(sg) = s->buf_len_rx; |
| 1441 | 1441 | ||
| 1442 | buf += s->buf_len_rx; | 1442 | buf += s->buf_len_rx; |
| 1443 | dma += s->buf_len_rx; | 1443 | dma += s->buf_len_rx; |
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c index 064031870ba0..ca0d3802f2af 100644 --- a/drivers/tty/serial/sunhv.c +++ b/drivers/tty/serial/sunhv.c | |||
| @@ -148,8 +148,10 @@ static int receive_chars_read(struct uart_port *port) | |||
| 148 | uart_handle_dcd_change(port, 1); | 148 | uart_handle_dcd_change(port, 1); |
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | for (i = 0; i < bytes_read; i++) | 151 | if (port->sysrq != 0 && *con_read_page) { |
| 152 | uart_handle_sysrq_char(port, con_read_page[i]); | 152 | for (i = 0; i < bytes_read; i++) |
| 153 | uart_handle_sysrq_char(port, con_read_page[i]); | ||
| 154 | } | ||
| 153 | 155 | ||
| 154 | if (port->state == NULL) | 156 | if (port->state == NULL) |
| 155 | continue; | 157 | continue; |
| @@ -168,17 +170,17 @@ struct sunhv_ops { | |||
| 168 | int (*receive_chars)(struct uart_port *port); | 170 | int (*receive_chars)(struct uart_port *port); |
| 169 | }; | 171 | }; |
| 170 | 172 | ||
| 171 | static struct sunhv_ops bychar_ops = { | 173 | static const struct sunhv_ops bychar_ops = { |
| 172 | .transmit_chars = transmit_chars_putchar, | 174 | .transmit_chars = transmit_chars_putchar, |
| 173 | .receive_chars = receive_chars_getchar, | 175 | .receive_chars = receive_chars_getchar, |
| 174 | }; | 176 | }; |
| 175 | 177 | ||
| 176 | static struct sunhv_ops bywrite_ops = { | 178 | static const struct sunhv_ops bywrite_ops = { |
| 177 | .transmit_chars = transmit_chars_write, | 179 | .transmit_chars = transmit_chars_write, |
| 178 | .receive_chars = receive_chars_read, | 180 | .receive_chars = receive_chars_read, |
| 179 | }; | 181 | }; |
| 180 | 182 | ||
| 181 | static struct sunhv_ops *sunhv_ops = &bychar_ops; | 183 | static const struct sunhv_ops *sunhv_ops = &bychar_ops; |
| 182 | 184 | ||
| 183 | static struct tty_port *receive_chars(struct uart_port *port) | 185 | static struct tty_port *receive_chars(struct uart_port *port) |
| 184 | { | 186 | { |
