mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 5/5] usb: ftdi-elan: Use pr_<level>
Date: Fri,  4 Apr 2014 15:16:07 -0700	[thread overview]
Message-ID: <f71532d26432d8474ff90b4691115f91edc4e99e.1396649386.git.joe@perches.com> (raw)
In-Reply-To: <cover.1396649386.git.joe@perches.com>

Use a more current logging style.

Add pr_fmt to prefix messages appropriately.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/usb/misc/ftdi-elan.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 10c54b3..8ab1f8f 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -35,6 +35,9 @@
  * via an ELAN U132 adapter.
  *
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/init.h>
@@ -623,7 +626,7 @@ static int ftdi_elan_open(struct inode *inode, struct file *file)
 	interface = usb_find_interface(&ftdi_elan_driver, subminor);
 
 	if (!interface) {
-		printk(KERN_ERR "can't find device for minor %d\n", subminor);
+		pr_err("can't find device for minor %d\n", subminor);
 		return -ENODEV;
 	} else {
 		struct usb_ftdi *ftdi = usb_get_intfdata(interface);
@@ -2722,10 +2725,8 @@ static int ftdi_elan_probe(struct usb_interface *interface,
 	struct usb_ftdi *ftdi;
 
 	ftdi = kzalloc(sizeof(struct usb_ftdi), GFP_KERNEL);
-	if (!ftdi) {
-		printk(KERN_ERR "Out of memory\n");
+	if (!ftdi)
 		return -ENOMEM;
-	}
 
 	mutex_lock(&ftdi_module_lock);
 	list_add_tail(&ftdi->ftdi_list, &ftdi_static_list);
@@ -2849,7 +2850,7 @@ static struct usb_driver ftdi_elan_driver = {
 static int __init ftdi_elan_init(void)
 {
 	int result;
-	printk(KERN_INFO "driver %s\n", ftdi_elan_driver.name);
+	pr_info("driver %s\n", ftdi_elan_driver.name);
 	mutex_init(&ftdi_module_lock);
 	INIT_LIST_HEAD(&ftdi_static_list);
 	status_queue = create_singlethread_workqueue("ftdi-status-control");
@@ -2866,8 +2867,7 @@ static int __init ftdi_elan_init(void)
 		destroy_workqueue(status_queue);
 		destroy_workqueue(command_queue);
 		destroy_workqueue(respond_queue);
-		printk(KERN_ERR "usb_register failed. Error number %d\n",
-		       result);
+		pr_err("usb_register failed. Error number %d\n", result);
 	}
 	return result;
 
@@ -2876,7 +2876,7 @@ err_respond_queue:
 err_command_queue:
 	destroy_workqueue(status_queue);
 err_status_queue:
-	printk(KERN_ERR "%s couldn't create workqueue\n", ftdi_elan_driver.name);
+	pr_err("%s couldn't create workqueue\n", ftdi_elan_driver.name);
 	return -ENOMEM;
 }
 
@@ -2885,7 +2885,7 @@ static void __exit ftdi_elan_exit(void)
 	struct usb_ftdi *ftdi;
 	struct usb_ftdi *temp;
 	usb_deregister(&ftdi_elan_driver);
-	printk(KERN_INFO "ftdi_u132 driver deregistered\n");
+	pr_info("ftdi_u132 driver deregistered\n");
 	list_for_each_entry_safe(ftdi, temp, &ftdi_static_list, ftdi_list) {
 		ftdi_status_cancel_work(ftdi);
 		ftdi_command_cancel_work(ftdi);
-- 
1.8.1.2.459.gbcd45b4.dirty


      parent reply	other threads:[~2014-04-04 22:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 22:16 [PATCH 0/5] ftdi-elan: neatening Joe Perches
2014-04-04 22:16 ` [PATCH 1/5] usb: ftdi-elan: Fix format fragments Joe Perches
2014-04-04 22:16 ` [PATCH 2/5] usb: ftdi-elan: Convert leading spaces to tabs Joe Perches
2014-04-04 22:16 ` [PATCH 3/5] usb: ftdi-elan: Coalesce formats Joe Perches
2014-04-04 22:16 ` [PATCH 4/5] usb: ftdi-elan: Coalesce string fragment Joe Perches
2014-04-04 22:16 ` Joe Perches [this message]

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=f71532d26432d8474ff90b4691115f91edc4e99e.1396649386.git.joe@perches.com \
    --to=joe@perches.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@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

all inboxes | Powered by JetHome®