linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: linux-i2c@vger.kernel.org
Cc: Wolfram Sang <wsa@the-dreams.de>
Subject: [PATCH 7/7] i2c: use pr_fmt in the core
Date: Sat,  9 Jul 2016 13:35:04 +0900	[thread overview]
Message-ID: <1468038904-2571-8-git-send-email-wsa@the-dreams.de> (raw)
In-Reply-To: <1468038904-2571-1-git-send-email-wsa@the-dreams.de>

Now that we revisited all error messages, we can use pr_fmt for the
remaining pr_* messages to ensure consistent output.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/i2c/i2c-core.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 7f376e9b007ba7..bd8be6b6c49246 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -27,6 +27,8 @@
    I2C slave support (c) 2014 by Wolfram Sang <wsa@sang-engineering.com>
  */
 
+#define pr_fmt(fmt) "i2c-core: " fmt
+
 #include <dt-bindings/i2c/i2c.h>
 #include <asm/uaccess.h>
 #include <linux/acpi.h>
@@ -1615,7 +1617,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 		goto out_list;
 
 	if (!adap->algo) {
-		pr_err("i2c-core: adapter '%s': no algo supplied!\n", adap->name);
+		pr_err("adapter '%s': no algo supplied!\n", adap->name);
 		goto out_list;
 	}
 
@@ -1639,8 +1641,7 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 	adap->dev.type = &i2c_adapter_type;
 	res = device_register(&adap->dev);
 	if (res) {
-		pr_err("i2c-core: adapter '%s': can't register device (%d)\n",
-			adap->name, res);
+		pr_err("adapter '%s': can't register device (%d)\n", adap->name, res);
 		goto out_list;
 	}
 
@@ -1831,8 +1832,7 @@ void i2c_del_adapter(struct i2c_adapter *adap)
 	found = idr_find(&i2c_adapter_idr, adap->nr);
 	mutex_unlock(&core_lock);
 	if (found != adap) {
-		pr_debug("i2c-core: attempting to delete unregistered "
-			 "adapter [%s]\n", adap->name);
+		pr_debug("attempting to delete unregistered adapter [%s]\n", adap->name);
 		return;
 	}
 
@@ -1992,7 +1992,7 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
 	if (res)
 		return res;
 
-	pr_debug("i2c-core: driver [%s] registered\n", driver->driver.name);
+	pr_debug("driver [%s] registered\n", driver->driver.name);
 
 	INIT_LIST_HEAD(&driver->clients);
 	/* Walk the adapters that are already present */
@@ -2019,7 +2019,7 @@ void i2c_del_driver(struct i2c_driver *driver)
 	i2c_for_each_dev(driver, __process_removed_driver);
 
 	driver_unregister(&driver->driver);
-	pr_debug("i2c-core: driver [%s] unregistered\n", driver->driver.name);
+	pr_debug("driver [%s] unregistered\n", driver->driver.name);
 }
 EXPORT_SYMBOL(i2c_del_driver);
 
@@ -2728,7 +2728,7 @@ static int i2c_smbus_check_pec(u8 cpec, struct i2c_msg *msg)
 	cpec = i2c_smbus_msg_pec(cpec, msg);
 
 	if (rpec != cpec) {
-		pr_debug("i2c-core: Bad PEC 0x%02x vs. 0x%02x\n",
+		pr_debug("Bad PEC 0x%02x vs. 0x%02x\n",
 			rpec, cpec);
 		return -EBADMSG;
 	}
-- 
2.8.1

  parent reply	other threads:[~2016-07-09  4:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-09  4:34 [PATCH 0/7] i2c: improve error messages when registering an adapter Wolfram Sang
2016-07-09  4:34 ` [PATCH 1/7] i2c: free idr when sanity checks in i2c_register_adapter() fail Wolfram Sang
2016-07-11 11:51   ` Jean Delvare
2016-07-09  4:34 ` [PATCH 2/7] i2c: cleanup i2c_register_adapter() by refactoring recovery init Wolfram Sang
2016-07-09  4:35 ` [PATCH 3/7] i2c: improve error messages in i2c_register_adapter() Wolfram Sang
2016-07-09  4:35 ` [PATCH 4/7] i2c: add error message when obtaining idr fails Wolfram Sang
2016-07-09  4:35 ` [PATCH 5/7] i2c: print more info when of_i2c_notify fails Wolfram Sang
2016-07-09  4:35 ` [PATCH 6/7] i2c: print more info when acpi_i2c_space_handler() fails Wolfram Sang
2016-07-09  8:11   ` Mika Westerberg
2016-07-09  4:35 ` Wolfram Sang [this message]
2016-07-14 12:47 ` [PATCH 0/7] i2c: improve error messages when registering an adapter Wolfram Sang

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=1468038904-2571-8-git-send-email-wsa@the-dreams.de \
    --to=wsa@the-dreams.de \
    --cc=linux-i2c@vger.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;
as well as URLs for NNTP newsgroup(s).