From: Ryan Mallon <rmallon@gmail.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] serial: serial_core.c: printk replacement
Date: Mon, 01 Sep 2014 10:11:29 +1000 [thread overview]
Message-ID: <5403B9B1.4010407@gmail.com> (raw)
In-Reply-To: <1409235328-24648-1-git-send-email-sudipm.mukherjee@gmail.com>
On 29/08/14 00:15, Sudip Mukherjee wrote:
> printk replaced with corresponding pr_err, dev_alert, dev_notice and pr_info.
> fixed two broken user-visible strings used by the corresponding printk
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>
> In the first patch i sent Greg suggested to use dev_err instead of pr_err , but as later Jiri pointed out in my later patches that uport->dev is having a null check so can not be used , tty_dev is also having a put_device , so back to pr_err.
>
> drivers/tty/serial/serial_core.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> @@ -1975,12 +1976,11 @@ 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)
> - printk(KERN_ERR "%s%s%s%d: Unable to drain "
> - "transmitter\n",
> - uport->dev ? dev_name(uport->dev) : "",
> - uport->dev ? ": " : "",
> - drv->dev_name,
> - drv->tty_driver->name_base + uport->line);
> + pr_err("%s%s%s%d: Unable to drain transmitter\n",
> + uport->dev ? dev_name(uport->dev) : "",
> + uport->dev ? ": " : "",
> + drv->dev_name,
> + drv->tty_driver->name_base + uport->line);
dev_printk() prints the value of dev_name() and handles the NULL case,
so this could be changed to:
dev_err(uport->dev, "%s%d: Unable to drain transmitter\n",
drv->dev_name,
drv->tty_driver->name_base + uport->line);
It might also be possible to remove drv->dev_name since dev_printk()
also prints the driver string, but I don't know if they are equivalent
in this case.
>
> if (console_suspend_enabled || !uart_console(uport))
> ops->shutdown(uport);
> @@ -2109,7 +2109,7 @@ 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%d at %s (irq = %d, base_baud = %d) is a %s\n",
> port->dev ? dev_name(port->dev) : "",
> port->dev ? ": " : "",
> drv->dev_name,
Same here.
~Ryan
next prev parent reply other threads:[~2014-09-01 0:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-28 14:15 [PATCH v2] serial: serial_core.c: printk replacement Sudip Mukherjee
2014-09-01 0:11 ` Ryan Mallon [this message]
2014-09-01 14:21 ` Sudip Mukherjee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5403B9B1.4010407@gmail.com \
--to=rmallon@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.