Commit 286d9b8c authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

serial: 8250: Use cached port name directly in messages

Since we have port name stored in struct uart_port, we better to use
that one instead of open coding.

This will make it one place source for easier maintenance or
modifications.

While here, replace printk_ratelimited(KERN_INFO ) by pr_info_ratelimited().
It seems last printk() call in 8250_port.c.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b340cbbe
...@@ -323,7 +323,7 @@ static int univ8250_setup_irq(struct uart_8250_port *up) ...@@ -323,7 +323,7 @@ static int univ8250_setup_irq(struct uart_8250_port *up)
* the port is opened so this value needs to be preserved. * the port is opened so this value needs to be preserved.
*/ */
if (up->bugs & UART_BUG_THRE) { if (up->bugs & UART_BUG_THRE) {
pr_debug("ttyS%d - using backup timer\n", serial_index(port)); pr_debug("%s - using backup timer\n", port->name);
up->timer.function = serial8250_backup_timeout; up->timer.function = serial8250_backup_timeout;
mod_timer(&up->timer, jiffies + mod_timer(&up->timer, jiffies +
......
...@@ -1211,8 +1211,8 @@ static void autoconfig(struct uart_8250_port *up) ...@@ -1211,8 +1211,8 @@ static void autoconfig(struct uart_8250_port *up)
if (!port->iobase && !port->mapbase && !port->membase) if (!port->iobase && !port->mapbase && !port->membase)
return; return;
DEBUG_AUTOCONF("ttyS%d: autoconf (0x%04lx, 0x%p): ", DEBUG_AUTOCONF("%s: autoconf (0x%04lx, 0x%p): ",
serial_index(port), port->iobase, port->membase); port->name, port->iobase, port->membase);
/* /*
* We really do need global IRQs disabled here - we're going to * We really do need global IRQs disabled here - we're going to
...@@ -1363,9 +1363,8 @@ static void autoconfig(struct uart_8250_port *up) ...@@ -1363,9 +1363,8 @@ static void autoconfig(struct uart_8250_port *up)
fintek_8250_probe(up); fintek_8250_probe(up);
if (up->capabilities != old_capabilities) { if (up->capabilities != old_capabilities) {
pr_warn("ttyS%d: detected caps %08x should be %08x\n", pr_warn("%s: detected caps %08x should be %08x\n",
serial_index(port), old_capabilities, port->name, old_capabilities, up->capabilities);
up->capabilities);
} }
out: out:
DEBUG_AUTOCONF("iir=%d ", scratch); DEBUG_AUTOCONF("iir=%d ", scratch);
...@@ -2212,8 +2211,7 @@ int serial8250_do_startup(struct uart_port *port) ...@@ -2212,8 +2211,7 @@ int serial8250_do_startup(struct uart_port *port)
*/ */
if (!(port->flags & UPF_BUGGY_UART) && if (!(port->flags & UPF_BUGGY_UART) &&
(serial_port_in(port, UART_LSR) == 0xff)) { (serial_port_in(port, UART_LSR) == 0xff)) {
printk_ratelimited(KERN_INFO "ttyS%d: LSR safety check engaged!\n", pr_info_ratelimited("%s: LSR safety check engaged!\n", port->name);
serial_index(port));
retval = -ENODEV; retval = -ENODEV;
goto out; goto out;
} }
...@@ -2245,8 +2243,8 @@ int serial8250_do_startup(struct uart_port *port) ...@@ -2245,8 +2243,8 @@ int serial8250_do_startup(struct uart_port *port)
(port->type == PORT_ALTR_16550_F128)) && (port->fifosize > 1)) { (port->type == PORT_ALTR_16550_F128)) && (port->fifosize > 1)) {
/* Bounds checking of TX threshold (valid 0 to fifosize-2) */ /* Bounds checking of TX threshold (valid 0 to fifosize-2) */
if ((up->tx_loadsz < 2) || (up->tx_loadsz > port->fifosize)) { if ((up->tx_loadsz < 2) || (up->tx_loadsz > port->fifosize)) {
pr_err("ttyS%d TX FIFO Threshold errors, skipping\n", pr_err("%s TX FIFO Threshold errors, skipping\n",
serial_index(port)); port->name);
} else { } else {
serial_port_out(port, UART_ALTR_AFR, serial_port_out(port, UART_ALTR_AFR,
UART_ALTR_EN_TXFIFO_LW); UART_ALTR_EN_TXFIFO_LW);
...@@ -2343,8 +2341,8 @@ int serial8250_do_startup(struct uart_port *port) ...@@ -2343,8 +2341,8 @@ int serial8250_do_startup(struct uart_port *port)
if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) { if (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT) {
if (!(up->bugs & UART_BUG_TXEN)) { if (!(up->bugs & UART_BUG_TXEN)) {
up->bugs |= UART_BUG_TXEN; up->bugs |= UART_BUG_TXEN;
pr_debug("ttyS%d - enabling bad tx status workarounds\n", pr_debug("%s - enabling bad tx status workarounds\n",
serial_index(port)); port->name);
} }
} else { } else {
up->bugs &= ~UART_BUG_TXEN; up->bugs &= ~UART_BUG_TXEN;
...@@ -2373,8 +2371,8 @@ int serial8250_do_startup(struct uart_port *port) ...@@ -2373,8 +2371,8 @@ int serial8250_do_startup(struct uart_port *port)
if (up->dma) { if (up->dma) {
retval = serial8250_request_dma(up); retval = serial8250_request_dma(up);
if (retval) { if (retval) {
pr_warn_ratelimited("ttyS%d - failed to request DMA\n", pr_warn_ratelimited("%s - failed to request DMA\n",
serial_index(port)); port->name);
up->dma = NULL; up->dma = NULL;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment