scripts: imx-usb-loader: print excluded USB device message only on verbose
PATCH v2 1/2 scripts: imx-usb-loader: print excluded USB device message only on verbose
If a USB device path is specified, it is expected that other devices will be ignored. So print that message only on verbose > 0.
---
Changes since (implicit) v1:
- added Ahmad's Reviewed-by
--- scripts/imx/imx-usb-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/imx/imx-usb-loader.c +1 -1
@@ -314,7 +314,7 @@ static int device_location_equal(libusb_device *device, const char *location)/* walked the full path, all elements match */ if (path_step == path_len) result =1 ; -else +else if (verbose)fprintf (stderr," excluded by device path option\n" ); done:
Signature · 7 lines
2.29.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH v2 2/2 scripts: imx-usb-loader: print USB VID/PID of excluded devices
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.
---
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(-)
scripts/imx/imx-usb-loader.c +5 -3
@@ -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 ;
Signature · 7 lines
2.29.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 11 lines · Bastian Krause
If a USB device path is specified, it is expected that other devices will be ignored. So print that message only on verbose > 0.
Signed-off-by Bastian Krause <[email protected]>Reviewed-by Ahmad Fatoum <[email protected]>---
Changes since (implicit) v1:
- added Ahmad's Reviewed-by--- scripts/imx/imx-usb-loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks
Sascha
Quoted 23 lines
scripts/imx/imx-usb-loader.c +1
-1@@ -314,7 +314,7 @@ static int device_location_equal(libusb_device *device, const char *location)/* walked the full path, all elements match */ if (path_step == path_len) result =1 ; -else +else if (verbose)fprintf (stderr," excluded by device path option\n" ); done:Signature · 7 lines
2.29.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox