Skip to content

Commit

Permalink
serial: core: Re-use struct uart_port {name} field
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Greg Kroah-Hartman committed Apr 8, 2017
1 parent 2e94d5a commit cade358
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/tty/serial/serial_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2117,9 +2117,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
for (tries = 3; !ops->tx_empty(uport) && tries; tries--)
msleep(10);
if (!tries)
dev_err(uport->dev, "%s%d: Unable to drain transmitter\n",
drv->dev_name,
drv->tty_driver->name_base + uport->line);
dev_err(uport->dev, "%s: Unable to drain transmitter\n",
uport->name);

ops->shutdown(uport);
}
Expand Down Expand Up @@ -2248,11 +2247,10 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
break;
}

printk(KERN_INFO "%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n",
pr_info("%s%s%s at %s (irq = %d, base_baud = %d) is a %s\n",
port->dev ? dev_name(port->dev) : "",
port->dev ? ": " : "",
drv->dev_name,
drv->tty_driver->name_base + port->line,
port->name,
address, port->irq, port->uartclk / 16, uart_type(port));
}

Expand Down

0 comments on commit cade358

Please sign in to comment.