[flashrom] [PATCH 1/2] libftdi complains that it is impossible to set interface on an already open device.

Ilya A. Volynets-Evenbakh ilya at total-knowledge.com
Thu Jun 14 17:07:58 CEST 2012


Call to ftdi_set_interface right after ftdi_init and before call to ftdi_usb_open

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya at total-knowledge.com>
---
 ft2232_spi.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/ft2232_spi.c b/ft2232_spi.c
index aec2fd5..aaca5f3 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -276,6 +276,11 @@ int ft2232_spi_init(void)
 		return -3;
 	}
 
+	if (ftdi_set_interface(ftdic, ft2232_interface) < 0) {
+		msg_perr("Unable to select interface: %s\n",
+				ftdic->error_str);
+	}
+
 	f = ftdi_usb_open(ftdic, ft2232_vid, ft2232_type);
 
 	if (f < 0 && f != -5) {
@@ -290,11 +295,6 @@ int ft2232_spi_init(void)
 		clock_5x = 0;
 	}
 
-	if (ftdi_set_interface(ftdic, ft2232_interface) < 0) {
-		msg_perr("Unable to select interface: %s\n",
-				ftdic->error_str);
-	}
-
 	if (ftdi_usb_reset(ftdic) < 0) {
 		msg_perr("Unable to reset FTDI device\n");
 	}
-- 
1.7.3.4





More information about the flashrom mailing list