diff options
author | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-08-12 13:32:56 +0000 |
---|---|---|
committer | hailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2009-08-12 13:32:56 +0000 |
commit | 3d303fd7d7c672976834b084c22cb52a99afb4d7 (patch) | |
tree | 07d03ad8b91541f09b13ac709ef85e93cbc339ca /ft2232_spi.c | |
parent | 7c6fee75f5ada829230b1cb4570c6f35029ac49e (diff) | |
download | flashrom-3d303fd7d7c672976834b084c22cb52a99afb4d7.tar.gz |
Use a common parameter variable for all programmers. This allows us to
reduce #ifdef clauses a lot if we compile out some programmers
completely.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@679 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r-- | ft2232_spi.c | 18 |
1 files changed, 8 insertions, 10 deletions
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 @@ int ft2232_spi_init(void) 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 @@ int ft2232_spi_init(void) "using default.\n"); } } - free(ft2232spi_param); + free(programmer_param); } printf_debug("Using device type %s ", (ft2232_type == FTDI_FT2232H) ? "2232H" : "4232H"); |