scripts: imx-usb-loader: print excluded USB device message only on verbose
PATCH 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.
--- 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 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.
--- scripts/imx/imx-usb-loader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
scripts/imx/imx-usb-loader.c +9 -2
@@ -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);
Signature · 7 lines
2.29.2 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/2] scripts: imx-usb-loader: print USB VID/PID of excluded devices
Quoted 19 lines · Bastian Krause
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 <[email protected]>--- scripts/imx/imx-usb-loader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)scripts/imx/imx-usb-loader.c +1
-1@@ -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) {
scripts/imx/imx-usb-loader.c static int device_location_equal(libusb_device *device, const char *location) · line 324
Quoted 10 lines
scripts/imx/imx-usb-loader.c +7
-1result =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" );
find_imx_dev already does libusb_get_device_descriptor(), so you could pass along the desc and print it here instead of asking for it again?
Quoted 5 lines
scripts/imx/imx-usb-loader.c +1
-0+ } done:free (loc);
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
Re: [PATCH 2/2] scripts: imx-usb-loader: print USB VID/PID of excluded devices
Quoted 18 lines · Ahmad Fatoum
Quoted 16 lines · Bastian Krause
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 <[email protected]>--- scripts/imx/imx-usb-loader.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)scripts/imx/imx-usb-loader.c +0
-0@@ -312,10 +312,17 @@ static int device_location_equal(libusb_device *device, const char *location) };
Quoted 16 lines
scripts/imx/imx-usb-loader.c static int device_location_equal(libusb_device *device, const char *location) · line 324
Quoted 13 lines
scripts/imx/imx-usb-loader.c +8
-2/* 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" );
find_imx_devalready doeslibusb_get_device_descriptor(), so you could pass along the desc and print it here instead of asking for it again?
Sure, will send a v2.
Bastian
Quoted 7 lines
Quoted 6 lines
scripts/imx/imx-usb-loader.c +1
-0+ } done:free (loc);
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
Quoted 4 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]>
Quoted 18 lines
--- 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 · 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