summaryrefslogtreecommitdiff
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-08-14 01:32:46 +0000
committerstefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-08-14 01:32:46 +0000
commitb9de3ee1035a93c7e00af4e10858996c09648f1a (patch)
treef88812d4a46f47a652718abd7f89e3c233569e81 /ft2232_spi.c
parent5c5da4d097854f17adc9690727a1435de38266c7 (diff)
downloadflashrom-b9de3ee1035a93c7e00af4e10858996c09648f1a.tar.gz
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@total-knowledge.com> Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1573 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r--ft2232_spi.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ft2232_spi.c b/ft2232_spi.c
index a5d3828..d599a8a 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -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");
}