Use a common parameter variable for all programmers
This allows us to reduce #ifdef clauses a lot if we compile out some
programmers completely.
Corresponding to flashrom svn r679.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 955bc56..db4db17 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -26,8 +26,6 @@
#include "flash.h"
#include "spi.h"
-char *ft2232spi_param = NULL;
-
#if FT2232_SPI_SUPPORT == 1
#include <ftdi.h>
@@ -83,16 +81,16 @@
return EXIT_FAILURE;
}
- if (ft2232spi_param && !strlen(ft2232spi_param)) {
- free(ft2232spi_param);
- ft2232spi_param = NULL;
+ if (programmer_param && !strlen(programmer_param)) {
+ free(programmer_param);
+ programmer_param = NULL;
}
- if (ft2232spi_param) {
- if (strstr(ft2232spi_param, "2232"))
+ if (programmer_param) {
+ if (strstr(programmer_param, "2232"))
ft2232_type = FTDI_FT2232H;
- if (strstr(ft2232spi_param, "4232"))
+ if (strstr(programmer_param, "4232"))
ft2232_type = FTDI_FT4232H;
- portpos = strstr(ft2232spi_param, "port=");
+ portpos = strstr(programmer_param, "port=");
if (portpos) {
portpos += 5;
switch (toupper(*portpos)) {
@@ -107,7 +105,7 @@
"using default.\n");
}
}
- free(ft2232spi_param);
+ free(programmer_param);
}
printf_debug("Using device type %s ",
(ft2232_type == FTDI_FT2232H) ? "2232H" : "4232H");