Commit 7c36d526 authored by Ilya A. Volynets-Evenbakh's avatar Ilya A. Volynets-Evenbakh Committed by Stefan Tauner
Browse files

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).

Corresponding to flashrom svn r1573.
Signed-off-by: default avatarIlya A. Volynets-Evenbakh <ilya@total-knowledge.com>
Acked-by: default avatarStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
parent 8dd97f9c
......@@ -277,6 +277,10 @@ 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) {
......@@ -291,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");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment