From: Bastian Krause <bst@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
Bastian Krause <bst@pengutronix.de>
Subject: [PATCH v2 2/2] scripts: imx-usb-loader: print USB VID/PID of excluded devices
Date: Fri, 30 Apr 2021 13:56:40 +0200 [thread overview]
Message-ID: <20210430115640.21011-2-bst@pengutronix.de> (raw)
In-Reply-To: <20210430115640.21011-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>
---
Changes since (implicit) v1:
- pass libusb_device_descriptor from find_imx_dev() instead of calling
libusb_get_device_descriptor() again
---
scripts/imx/imx-usb-loader.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/scripts/imx/imx-usb-loader.c b/scripts/imx/imx-usb-loader.c
index 6f9104e816..cff77f27f2 100644
--- a/scripts/imx/imx-usb-loader.c
+++ b/scripts/imx/imx-usb-loader.c
@@ -267,7 +267,8 @@ static void list_imx_device_types(void)
}
}
-static int device_location_equal(libusb_device *device, const char *location)
+static int device_location_equal(libusb_device *device, const char *location,
+ struct libusb_device_descriptor desc)
{
uint8_t port_path[MAX_USB_PORTS];
uint8_t dev_bus;
@@ -315,7 +316,8 @@ static int device_location_equal(libusb_device *device, const char *location)
if (path_step == path_len)
result = 1;
else if (verbose)
- fprintf(stderr, " excluded by device path option\n");
+ fprintf(stderr, "USB device [%04x:%04x] excluded by device path option\n",
+ desc.idVendor, desc.idProduct);
done:
free(loc);
@@ -343,7 +345,7 @@ static libusb_device *find_imx_dev(libusb_device **devs, const struct mach_id **
return NULL;
}
- if (location && !device_location_equal(dev, location)) {
+ if (location && !device_location_equal(dev, location, desc)) {
libusb_close(usb_dev_handle);
usb_dev_handle = NULL;
continue;
--
2.29.2
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2021-04-30 11:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 11:56 [PATCH v2 1/2] scripts: imx-usb-loader: print excluded USB device message only on verbose Bastian Krause
2021-04-30 11:56 ` Bastian Krause [this message]
2021-05-03 10:37 ` Sascha Hauer
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=20210430115640.21011-2-bst@pengutronix.de \
--to=bst@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox