diff options
author | Matthew Wilcox <willy@linux.intel.com> | 2009-09-24 16:19:49 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 11:55:13 -0800 |
commit | 9eb66f71318df6ab73bad2fb924a36777cf0220e (patch) | |
tree | 66d9d80f97dba26e94b6ac20ef8b2910eb58f03d /drivers/usb/storage/usb.c | |
parent | 00fa43ef09c6bb357d58c14a99181cce09c315c6 (diff) | |
download | blackbird-op-linux-9eb66f71318df6ab73bad2fb924a36777cf0220e.tar.gz blackbird-op-linux-9eb66f71318df6ab73bad2fb924a36777cf0220e.zip |
USB Storage: Make driver less chatty when it finds a new device
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>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/storage/usb.c')
-rw-r--r-- | 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 783548485868..01e43a13a6bf 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_intf->dev, "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_intf->dev, "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_intf->dev, "scan complete\n"); /* Should we unbind if no devices were detected? */ } |