Commit 2f2dafe7 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman

serial: serial_core.c: printk replacement

printk replaced with corresponding dev_* .
fixed two broken user-visible strings used by the corresponding printk.
the null check for uport->dev and port->dev is removed as dev_* will check for
null while printing.
printing of dev_name(uport->dev) and dev_name(port->dev) also removed as those
are being printed by dev_* .
Signed-off-by: default avatarSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a1d51aa2
...@@ -892,10 +892,11 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port, ...@@ -892,10 +892,11 @@ static int uart_set_info(struct tty_struct *tty, struct tty_port *port,
*/ */
if (uport->flags & UPF_SPD_MASK) { if (uport->flags & UPF_SPD_MASK) {
char buf[64]; char buf[64];
printk(KERN_NOTICE
"%s sets custom speed on %s. This " dev_notice(uport->dev,
"is deprecated.\n", current->comm, "%s sets custom speed on %s. This is deprecated.\n",
tty_name(port->tty, buf)); current->comm,
tty_name(port->tty, buf));
} }
uart_change_speed(tty, state, NULL); uart_change_speed(tty, state, NULL);
} }
...@@ -1975,12 +1976,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -1975,12 +1976,9 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
for (tries = 3; !ops->tx_empty(uport) && tries; tries--) for (tries = 3; !ops->tx_empty(uport) && tries; tries--)
msleep(10); msleep(10);
if (!tries) if (!tries)
printk(KERN_ERR "%s%s%s%d: Unable to drain " dev_err(uport->dev, "%s%d: Unable to drain transmitter\n",
"transmitter\n", drv->dev_name,
uport->dev ? dev_name(uport->dev) : "", drv->tty_driver->name_base + uport->line);
uport->dev ? ": " : "",
drv->dev_name,
drv->tty_driver->name_base + uport->line);
if (console_suspend_enabled || !uart_console(uport)) if (console_suspend_enabled || !uart_console(uport))
ops->shutdown(uport); ops->shutdown(uport);
...@@ -2109,9 +2107,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port) ...@@ -2109,9 +2107,7 @@ uart_report_port(struct uart_driver *drv, struct uart_port *port)
break; break;
} }
printk(KERN_INFO "%s%s%s%d at %s (irq = %d, base_baud = %d) is a %s\n", dev_info(port->dev, "%s%d at %s (irq = %d, base_baud = %d) is a %s\n",
port->dev ? dev_name(port->dev) : "",
port->dev ? ": " : "",
drv->dev_name, drv->dev_name,
drv->tty_driver->name_base + port->line, drv->tty_driver->name_base + port->line,
address, port->irq, port->uartclk / 16, uart_type(port)); address, port->irq, port->uartclk / 16, uart_type(port));
...@@ -2640,7 +2636,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -2640,7 +2636,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport)
if (likely(!IS_ERR(tty_dev))) { if (likely(!IS_ERR(tty_dev))) {
device_set_wakeup_capable(tty_dev, 1); device_set_wakeup_capable(tty_dev, 1);
} else { } else {
printk(KERN_ERR "Cannot register tty device on line %d\n", dev_err(uport->dev, "Cannot register tty device on line %d\n",
uport->line); uport->line);
} }
...@@ -2675,7 +2671,7 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport) ...@@ -2675,7 +2671,7 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport)
BUG_ON(in_interrupt()); BUG_ON(in_interrupt());
if (state->uart_port != uport) if (state->uart_port != uport)
printk(KERN_ALERT "Removing wrong port: %p != %p\n", dev_alert(uport->dev, "Removing wrong port: %p != %p\n",
state->uart_port, uport); state->uart_port, uport);
mutex_lock(&port_mutex); mutex_lock(&port_mutex);
......
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