summaryrefslogtreecommitdiffstats
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2022-08-12 13:47:29 +1000
committerAnastasia Klimchuk <aklm@chromium.org>2022-09-07 01:56:58 +0000
commit5c710ea54afabf8c0e5f3c8ada45c4a5f9f0781b (patch)
treef320b3bb2deace62c899f5015dbe348321ad7aad /ft2232_spi.c
parentc3df94cb96dd0a6771926e2c6a1ed6309452de83 (diff)
downloadflashrom-5c710ea54afabf8c0e5f3c8ada45c4a5f9f0781b.tar.gz
flashrom-5c710ea54afabf8c0e5f3c8ada45c4a5f9f0781b.tar.bz2
flashrom-5c710ea54afabf8c0e5f3c8ada45c4a5f9f0781b.zip
tree: Port programmers to pass programmer_cfg to extractors
Ran; ``` $ find -name '*.c' -exec sed -i 's/extract_programmer_param_str(NULL/extract_programmer_param_str(cfg/g' '{}' \; ``` Manually fix i2c_helper_linux.c and other cases after. Treat cases of; - pcidev.c , and - usb_device.c as exceptional to be dealt with in later patches. Change-Id: If7b7987e803d35582dda219652a6fc3ed5729b47 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/66656 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-by: Felix Singer <felixsinger@posteo.net>
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r--ft2232_spi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/ft2232_spi.c b/ft2232_spi.c
index c7dbbb2a3..2971c2ebf 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -340,7 +340,7 @@ static int ft2232_spi_init(const struct programmer_cfg *cfg)
struct ftdi_context ftdic;
struct ft2232_data *spi_data;
- arg = extract_programmer_param_str(NULL, "type");
+ arg = extract_programmer_param_str(cfg, "type");
if (arg) {
if (!strcasecmp(arg, "2232H")) {
ft2232_type = FTDI_FT2232H_PID;
@@ -447,7 +447,7 @@ static int ft2232_spi_init(const struct programmer_cfg *cfg)
/* Remember reserved pins before pindir gets modified. */
const uint8_t rsv_bits = pindir & 0xf0;
- arg = extract_programmer_param_str(NULL, "port");
+ arg = extract_programmer_param_str(cfg, "port");
if (arg) {
switch (toupper((unsigned char)*arg)) {
case 'A':
@@ -480,7 +480,7 @@ static int ft2232_spi_init(const struct programmer_cfg *cfg)
}
free(arg);
- arg = extract_programmer_param_str(NULL, "divisor");
+ arg = extract_programmer_param_str(cfg, "divisor");
if (arg && strlen(arg)) {
unsigned int temp = 0;
char *endptr;
@@ -496,7 +496,7 @@ static int ft2232_spi_init(const struct programmer_cfg *cfg)
free(arg);
bool csgpiol_set = false;
- arg = extract_programmer_param_str(NULL, "csgpiol");
+ arg = extract_programmer_param_str(cfg, "csgpiol");
if (arg) {
csgpiol_set = true;
msg_pwarn("Deprecation warning: `csgpiol` is deprecated and will be removed "
@@ -529,7 +529,7 @@ static int ft2232_spi_init(const struct programmer_cfg *cfg)
for (int pin = 0; pin < 4; pin++) {
char gpiol_param[7];
snprintf(gpiol_param, sizeof(gpiol_param), "gpiol%d", pin);
- arg = extract_programmer_param_str(NULL, gpiol_param);
+ arg = extract_programmer_param_str(cfg, gpiol_param);
if (!arg)
continue;
@@ -602,8 +602,8 @@ format_error:
msg_perr("Unable to select channel (%s).\n", ftdi_get_error_string(&ftdic));
}
- arg = extract_programmer_param_str(NULL, "serial");
- arg2 = extract_programmer_param_str(NULL, "description");
+ arg = extract_programmer_param_str(cfg, "serial");
+ arg2 = extract_programmer_param_str(cfg, "description");
f = ftdi_usb_open_desc(&ftdic, ft2232_vid, ft2232_type, arg2, arg);