public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: also announce bcdDevice
@ 2012-05-05 11:51 Paul Bolle
  2012-05-05 12:14 ` Martin Mokrejs
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Bolle @ 2012-05-05 11:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel

Currently announce_device() does print the idVendor and idProduct values
but does not print the bcdDevice value. USB devices are accurately
identified by all three values. See, for instance, the USB storage
quirks which will only apply for a certain (range of) bcdDevice
value(s). So it seems useful to also print bcdDevice when announcing USB
devices.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
0) This is something I ran into while trying to track down the log
errors generated by each of the USB sticks I happen to have lying
around. Of course, there are other ways to track down the bcdDevice
value of a specific device ("lusb -v -d $vendorid:$productid | grep
bcdDevice" or "usb-devices | grep $vendorid.*$productid" come to mind).
But since idVendor and idProduct are already printed by this debugging
aid I think adding bcdDevice makes sense too. But is this all worth the
small bit of additional noise?

1) The patch generates a checkpatch warning: "quoted string split across
lines". But since it is hard to grep for this entire string without
knowing the printk "conversion specifications" in the string beforehand,
I think the warning can be ignored here. Note that I actually found this
string by git grepping for just "New USB device found".

 drivers/usb/core/Kconfig |    4 ++--
 drivers/usb/core/hub.c   |    6 ++++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 18d02e3..85f795b 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -14,8 +14,8 @@ config USB_ANNOUNCE_NEW_DEVICES
 	depends on USB
 	default N
 	help
-	  Say Y here if you want the USB core to always announce the
-	  idVendor, idProduct, Manufacturer, Product, and SerialNumber
+	  Say Y here if you want the USB core to always announce the idVendor,
+	  idProduct, bcdDevice, Manufacturer, Product, and SerialNumber
 	  strings for every new USB device to the syslog.  This option is
 	  usually used by distro vendors to help with debugging and to
 	  let users know what specific device was added to the machine
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index ec6c97d..6e1bfaea 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -1726,9 +1726,11 @@ static void show_string(struct usb_device *udev, char *id, char *string)
 
 static void announce_device(struct usb_device *udev)
 {
-	dev_info(&udev->dev, "New USB device found, idVendor=%04x, idProduct=%04x\n",
+	dev_info(&udev->dev, "New USB device found, idVendor=%04x, "
+		"idProduct=%04x, bcdDevice=%04x\n",
 		le16_to_cpu(udev->descriptor.idVendor),
-		le16_to_cpu(udev->descriptor.idProduct));
+		le16_to_cpu(udev->descriptor.idProduct),
+		le16_to_cpu(udev->descriptor.bcdDevice));
 	dev_info(&udev->dev,
 		"New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
 		udev->descriptor.iManufacturer,
-- 
1.7.7.6




^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-05-05 17:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-05 11:51 [PATCH] usb: also announce bcdDevice Paul Bolle
2012-05-05 12:14 ` Martin Mokrejs
2012-05-05 14:52   ` Greg Kroah-Hartman
2012-05-05 15:09     ` Martin Mokrejs
2012-05-05 15:28       ` Alan Stern
2012-05-05 17:49       ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox