Re: [PATCH 2/3] USB Storage: Make driver less chatty when it finds a new device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 20 Sep 2009, Matthew Wilcox wrote:

> From: Matthew Wilcox <willy@xxxxxxxxxxxxxxx>
> 
> 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.

> -	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? */
>  	}

Each of these dev_dbg() lines should refer to pusb_intf instead of
pusb_dev.  See the existing code at the end of adjust_quirks().  Once
this change is made, the second dev_dbg() line won't need to specify
"usb-storage:" at the start of the message.

With those changes in place,

	Acked-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux