mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Bastian Krause <bst@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Bastian Krause <bst@pengutronix.de>
Subject: [PATCH 2/2] scripts: imx-usb-loader: print USB VID/PID of excluded devices
Date: Fri, 30 Apr 2021 11:19:30 +0200	[thread overview]
Message-ID: <20210430091930.30187-2-bst@pengutronix.de> (raw)
In-Reply-To: <20210430091930.30187-1-bst@pengutronix.de>

On hosts with multiple USB devices connected, multiple "excluded by
device path option" messages can be observed. Add the USB VID/PID to
these messages to give them some additional value.

Signed-off-by: Bastian Krause <bst@pengutronix.de>
---
 scripts/imx/imx-usb-loader.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 6f9104e816..765ba61310 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -312,10 +312,17 @@ static int device_location_equal(libusb_device *device, const char *location)
 	};
 
 	/* walked the full path, all elements match */
-	if (path_step == path_len)
+	if (path_step == path_len) {
 		result = 1;
-	else if (verbose)
+	} else if (verbose) {
+		struct libusb_device_descriptor desc;
+
+		if (!libusb_get_device_descriptor(device, &desc));
+			fprintf(stderr, "USB device [%04x:%04x]",
+				desc.idVendor, desc.idProduct);
+
 		fprintf(stderr, " excluded by device path option\n");
+	}
 
 done:
 	free(loc);
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-04-30  9:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30  9:19 [PATCH 1/2] scripts: imx-usb-loader: print excluded USB device message only on verbose Bastian Krause
2021-04-30  9:19 ` Bastian Krause [this message]
2021-04-30  9:47   ` [PATCH 2/2] scripts: imx-usb-loader: print USB VID/PID of excluded devices Ahmad Fatoum
2021-04-30 11:53     ` Bastian Krause
2021-04-30  9:44 ` [PATCH 1/2] scripts: imx-usb-loader: print excluded USB device message only on verbose Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210430091930.30187-2-bst@pengutronix.de \
    --to=bst@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --subject='Re: [PATCH 2/2] scripts: imx-usb-loader: print USB VID/PID of excluded devices' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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