Skip to content

Commit cade358

Browse files
andy-shevgregkh
authored andcommitted
serial: core: Re-use struct uart_port {name} field
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(KERN_INFO ) by pr_info(). It seems last printk() call in serial_core.c. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 2e94d5a commit cade358

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

drivers/tty/serial/serial_core.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,9 +2117,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
21172117
for (tries = 3; !ops->tx_empty(uport) && tries; tries--)
21182118
msleep(10);
21192119
if (!tries)
2120-
dev_err(uport->dev, "%s%d: Unable to drain transmitter\n",
2121-
drv->dev_name,
2122-
drv->tty_driver->name_base + uport->line);
2120+
dev_err(uport->dev, "%s: Unable to drain transmitter\n",
2121+
uport->name);
21232122

21242123
ops->shutdown(uport);
21252124
}
@@ -2248,11 +2247,10 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
22482247
break;
22492248
}
22502249

2251-
printk(KERN_INFO "%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n",
2250+
pr_info("%s%s%s at %s (irq = %d, base_baud = %d) is a %s\n",
22522251
port->dev ? dev_name(port->dev) : "",
22532252
port->dev ? ": " : "",
2254-
drv->dev_name,
2255-
drv->tty_driver->name_base + port->line,
2253+
port->name,
22562254
address, port->irq, port->uartclk / 16, uart_type(port));
22572255
}
22582256

0 commit comments

Comments
 (0)