[flashrom] [commit] r1573 - trunk

repository service svn at flashrom.org
Tue Aug 14 03:32:47 CEST 2012


Author: stefanct
Date: Tue Aug 14 03:32:46 2012
New Revision: 1573
URL: http://flashrom.org/trac/flashrom/changeset/1573

Log:
Call ftdi_set_interface right after ftdi_init and before ftdi_usb_open.

Else libftdi complains that it is impossible to set interface on an already
open device since 1c5fa36b67bc30742eee94ed3e3648fcd4640f24
(which will probably end up in libftdi 0.21).

Signed-off-by: Ilya A. Volynets-Evenbakh <ilya at total-knowledge.com>
Acked-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>

Modified:
   trunk/ft2232_spi.c

Modified: trunk/ft2232_spi.c
==============================================================================
--- trunk/ft2232_spi.c	Tue Aug 14 01:43:46 2012	(r1572)
+++ trunk/ft2232_spi.c	Tue Aug 14 03:32:46 2012	(r1573)
@@ -277,6 +277,10 @@
 		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) {
@@ -291,11 +295,6 @@
 		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");
 	}




More information about the flashrom mailing list