linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: linux-scsi@vger.kernel.org, linux-usb@vger.kernel.org
Subject: [PATCH 2/3] USB Storage: Make driver less chatty when it finds a new device
Date: Sun, 20 Sep 2009 16:57:58 -0600	[thread overview]
Message-ID: <20090920225758.GE3690@parisc-linux.org> (raw)
In-Reply-To: <20090920225348.GB3690@parisc-linux.org>

From: Matthew Wilcox <willy@linux.intel.com>

Use dev_dbg() instead of an unconditional printk(KERN_DEBUG).  This has
two benefits; one is that it identifies the USB device which the messages
related to, and the other is that the messages won't be produced unless
debug is turned on.

Enable the debug messages when CONFIG_USB_STORAGE_DEBUG is set.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
---
 drivers/usb/storage/usb.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index 8060b85..40c21a9 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -45,6 +45,10 @@
  * 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+#ifdef CONFIG_USB_STORAGE_DEBUG
+#define DEBUG
+#endif
+
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/freezer.h>
@@ -808,14 +812,13 @@ static int usb_stor_scan_thread(void * __us)
 {
 	struct us_data *us = (struct us_data *)__us;
 
-	printk(KERN_DEBUG
-		"usb-storage: device found at %d\n", us->pusb_dev->devnum);
+	dev_dbg(&us->pusb_dev->dev, "usb-storage device found\n");
 
 	set_freezable();
 	/* Wait for the timeout to expire or for a disconnect */
 	if (delay_use > 0) {
-		printk(KERN_DEBUG "usb-storage: waiting for device "
-				"to settle before scanning\n");
+		dev_dbg(&us->pusb_dev->dev, "usb-storage: waiting for device "
+			"to settle before scanning\n");
 		wait_event_freezable_timeout(us->delay_wait,
 				test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
 				delay_use * HZ);
@@ -832,7 +835,7 @@ static int usb_stor_scan_thread(void * __us)
 			mutex_unlock(&us->dev_mutex);
 		}
 		scsi_scan_host(us_to_host(us));
-		printk(KERN_DEBUG "usb-storage: device scan complete\n");
+		dev_dbg(&us->pusb_dev->dev, "usb-storage scan complete\n");
 
 		/* Should we unbind if no devices were detected? */
 	}
-- 
1.6.3.3

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  reply	other threads:[~2009-09-20 22:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-20 22:53 Reducing the verbosity of inserting a USB storage device Matthew Wilcox
2009-09-20 22:57 ` Matthew Wilcox [this message]
2009-09-21  2:09   ` [PATCH 2/3] USB Storage: Make driver less chatty when it finds a new device Alan Stern
2009-09-20 22:58 ` [PATCH 3/3] sd.c: Make initialisation less verbose Matthew Wilcox
     [not found] ` <20090920225348.GB3690-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2009-09-20 22:56   ` [PATCH 1/3] Allow SCSI hosts to be " Matthew Wilcox
2009-09-22 13:09     ` Christoph Hellwig
2009-09-21  1:09   ` Reducing the verbosity of inserting a USB storage device Alan Stern
     [not found]     ` <Pine.LNX.4.44L0.0909202104300.14465-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2009-09-24 22:17       ` Matthew Wilcox
2009-09-24 22:18         ` [PATCH 1/4] Convert a dev_info to a dev_dbg Matthew Wilcox
     [not found]         ` <20090924221702.GA7943-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2009-09-24 22:19           ` [PATCH 2/4] usb-storage: Associate the name of the interface with the scsi host Matthew Wilcox
2009-09-25 14:29             ` Alan Stern
2009-09-24 22:19         ` [PATCH 3/4] USB Storage: Make driver less chatty when it finds a new device Matthew Wilcox
2009-09-24 22:20         ` [PATCH 4/4] sd.c: Make initialisation less verbose Matthew Wilcox
     [not found]           ` <20090924222056.GE7943-6jwH94ZQLHl74goWV3ctuw@public.gmane.org>
2009-10-09 17:54             ` Greg KH
2009-09-21  2:07   ` Reducing the verbosity of inserting a USB storage device Matthew Dharm

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=20090920225758.GE3690@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=linux-scsi@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;
as well as URLs for NNTP newsgroup(s).