HAOUAS Elyes has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/34403 )
Change subject: pickit2_spi: Remove dead assignment ......................................................................
pickit2_spi: Remove dead assignment
We never read the first 'ret', so remove it. Also, print the version only when the command succeeded.
Change-Id: I4aac5e1f3bd0604b079e1fdd9b7f09f1f4fc2d7f Signed-off-by: Elyes HAOUAS ehaouas@noos.fr --- M pickit2_spi.c 1 file changed, 2 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/03/34403/1
diff --git a/pickit2_spi.c b/pickit2_spi.c index 6d9b28f..4e9ca1d 100644 --- a/pickit2_spi.c +++ b/pickit2_spi.c @@ -93,17 +93,16 @@ { int ret; uint8_t command[CMD_LENGTH] = {CMD_GET_VERSION, CMD_END_OF_BUFFER}; - int transferred; - ret = libusb_interrupt_transfer(pickit2_handle, ENDPOINT_OUT, command, CMD_LENGTH, &transferred, DFLT_TIMEOUT); + ret = libusb_interrupt_transfer(pickit2_handle, ENDPOINT_IN, command, CMD_LENGTH, &transferred, DFLT_TIMEOUT);
- msg_pdbg("PICkit2 Firmware Version: %d.%d\n", (int)command[0], (int)command[1]); if (ret != 0) { msg_perr("Command Get Firmware Version failed!\n"); return 1; }
+ msg_pdbg("PICkit2 Firmware Version: %d.%d\n", (int)command[0], (int)command[1]); return 0; }