aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/storage
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@linux.intel.com>2009-09-24 18:19:49 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 14:55:13 -0500
commit9eb66f71318df6ab73bad2fb924a36777cf0220e (patch)
tree66d9d80f97dba26e94b6ac20ef8b2910eb58f03d /drivers/usb/storage
parent00fa43ef09c6bb357d58c14a99181cce09c315c6 (diff)
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')
-rw-r--r--drivers/usb/storage/usb.c13
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 @@
45 * 675 Mass Ave, Cambridge, MA 02139, USA. 45 * 675 Mass Ave, Cambridge, MA 02139, USA.
46 */ 46 */
47 47
48#ifdef CONFIG_USB_STORAGE_DEBUG
49#define DEBUG
50#endif
51
48#include <linux/sched.h> 52#include <linux/sched.h>
49#include <linux/errno.h> 53#include <linux/errno.h>
50#include <linux/freezer.h> 54#include <linux/freezer.h>
@@ -808,14 +812,13 @@ static int usb_stor_scan_thread(void * __us)
808{ 812{
809 struct us_data *us = (struct us_data *)__us; 813 struct us_data *us = (struct us_data *)__us;
810 814
811 printk(KERN_DEBUG 815 dev_dbg(&us->pusb_intf->dev, "device found\n");
812 "usb-storage: device found at %d\n", us->pusb_dev->devnum);
813 816
814 set_freezable(); 817 set_freezable();
815 /* Wait for the timeout to expire or for a disconnect */ 818 /* Wait for the timeout to expire or for a disconnect */
816 if (delay_use > 0) { 819 if (delay_use > 0) {
817 printk(KERN_DEBUG "usb-storage: waiting for device " 820 dev_dbg(&us->pusb_intf->dev, "waiting for device to settle "
818 "to settle before scanning\n"); 821 "before scanning\n");
819 wait_event_freezable_timeout(us->delay_wait, 822 wait_event_freezable_timeout(us->delay_wait,
820 test_bit(US_FLIDX_DONT_SCAN, &us->dflags), 823 test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
821 delay_use * HZ); 824 delay_use * HZ);
@@ -832,7 +835,7 @@ static int usb_stor_scan_thread(void * __us)
832 mutex_unlock(&us->dev_mutex); 835 mutex_unlock(&us->dev_mutex);
833 } 836 }
834 scsi_scan_host(us_to_host(us)); 837 scsi_scan_host(us_to_host(us));
835 printk(KERN_DEBUG "usb-storage: device scan complete\n"); 838 dev_dbg(&us->pusb_intf->dev, "scan complete\n");
836 839
837 /* Should we unbind if no devices were detected? */ 840 /* Should we unbind if no devices were detected? */
838 } 841 }