[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.44L0.1803241155560.30456-100000@netrider.rowland.org>
Date: Sat, 24 Mar 2018 12:06:20 -0400 (EDT)
From: Alan Stern <stern@...land.harvard.edu>
To: Benson Leung <bleung@...omium.org>
cc: gregkh@...uxfoundation.org, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <achant@...gle.com>,
<bleung@...gle.com>
Subject: Re: [PATCH v2] USB: announce bcdDevice as well as idVendor, idProduct.
On Fri, 23 Mar 2018, Benson Leung wrote:
> Print bcdDevice which is used by vendors to identify different versions
> of the same product (or different versions of firmware).
>
> Adding this to the logs will be useful for support purposes.
>
> Match the %2x.%02x formatting that's used by lsusb -v for this same value.
>
> Signed-off-by: Benson Leung <bleung@...omium.org>
> --
> v2: Format for decimal output.
> ---
> drivers/usb/core/hub.c | 19 ++++++++++++-------
> 1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index aaeef03c0d83..624cde7ffcea 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -2192,14 +2192,19 @@ 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",
> - le16_to_cpu(udev->descriptor.idVendor),
> - le16_to_cpu(udev->descriptor.idProduct));
> + u16 bcdDevice;
> +
> + bcdDevice = le16_to_cpu(udev->descriptor.bcdDevice);
> + dev_info(&udev->dev,
> + "New USB device found, idVendor=%04x, idProduct=%04x, bcdDevice=%2x.%02x\n",
> + le16_to_cpu(udev->descriptor.idVendor),
Unnecessary and incorrect whitespace changes.
> + le16_to_cpu(udev->descriptor.idProduct),
> + bcdDevice >> 8, bcdDevice & 0xff);
> dev_info(&udev->dev,
> - "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
> - udev->descriptor.iManufacturer,
> - udev->descriptor.iProduct,
> - udev->descriptor.iSerialNumber);
> + "New USB device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
> + udev->descriptor.iManufacturer,
> + udev->descriptor.iProduct,
> + udev->descriptor.iSerialNumber);
Same here.
Alan Stern
Powered by blists - more mailing lists