public inbox for linux-serial@vger.kernel.org
 help / color / mirror / Atom feed
From: Zijun Hu <zijun_hu@icloud.com>
To: Rob Herring <robh@kernel.org>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>
Cc: Zijun Hu <zijun_hu@icloud.com>,
	linux-serial@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Zijun Hu <quic_zijuhu@quicinc.com>
Subject: [PATCH v2 2/2] serdev: Remove repeated device name in dev_(err|dbg) messages
Date: Thu, 24 Apr 2025 20:23:24 +0800	[thread overview]
Message-ID: <20250424-fix_serdev-v2-2-a1226ed77435@quicinc.com> (raw)
In-Reply-To: <20250424-fix_serdev-v2-0-a1226ed77435@quicinc.com>

From: Zijun Hu <quic_zijuhu@quicinc.com>

There are serval dev_err() and dev_dbg() usages shown below:

dev_dbg(dev, "...%s...", dev_name(dev))

The device name is repeated since dev_dbg() also prints device
name as prefix.

Fix by optimizing the messages printed.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 drivers/tty/serdev/core.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 971651b8e18dcbb5b7983cdfa19e7d60d4cd292b..f00106de76a0f1e547310c7d21cc2fe3d5869e28 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -118,12 +118,12 @@ int serdev_device_add(struct serdev_device *serdev)
 
 	err = device_add(&serdev->dev);
 	if (err < 0) {
-		dev_err(&serdev->dev, "Can't add %s, status %pe\n",
-			dev_name(&serdev->dev), ERR_PTR(err));
+		dev_err(&serdev->dev, "Can't add serdev, status %pe\n",
+			ERR_PTR(err));
 		goto err_clear_serdev;
 	}
 
-	dev_dbg(&serdev->dev, "device %s registered\n", dev_name(&serdev->dev));
+	dev_dbg(&serdev->dev, "serdev registered successfully\n");
 
 	return 0;
 
@@ -783,8 +783,8 @@ int serdev_controller_add(struct serdev_controller *ctrl)
 		goto err_rpm_disable;
 	}
 
-	dev_dbg(&ctrl->dev, "%s registered: dev:%p\n",
-		dev_name(&ctrl->dev), &ctrl->dev);
+	dev_dbg(&ctrl->dev, "serdev controller registered: dev:%p\n",
+		&ctrl->dev);
 	return 0;
 
 err_rpm_disable:

-- 
2.34.1


  parent reply	other threads:[~2025-04-24 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24 12:23 [PATCH v2 0/2] serdev: Improve messages printed by dev_err() and dev_dbg() Zijun Hu
2025-04-24 12:23 ` [PATCH v2 1/2] serdev: Get serdev controller's name by dev_name() Zijun Hu
2025-04-24 12:23 ` Zijun Hu [this message]
2025-04-24 18:34   ` [PATCH v2 2/2] serdev: Remove repeated device name in dev_(err|dbg) messages Rob Herring
2025-04-25 11:36     ` Zijun Hu
2025-04-25  5:38   ` Jiri Slaby
2025-04-25 11:37     ` Zijun Hu

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=20250424-fix_serdev-v2-2-a1226ed77435@quicinc.com \
    --to=zijun_hu@icloud.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=quic_zijuhu@quicinc.com \
    --cc=robh@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox