diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-08-12 13:28:46 +1000 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-09-07 01:49:49 +0000 |
commit | e316f1970d9c51ab167be0835a4cfbadf92e9653 (patch) | |
tree | 3d021eb4f804b05ec57aad9c5e3cd46f1b7003b8 /ft2232_spi.c | |
parent | 33af2e695d28a89e0eaf9b058310bc5bf0e6e80f (diff) | |
download | flashrom-e316f1970d9c51ab167be0835a4cfbadf92e9653.tar.gz flashrom-e316f1970d9c51ab167be0835a4cfbadf92e9653.tar.bz2 flashrom-e316f1970d9c51ab167be0835a4cfbadf92e9653.zip |
tree: Change signature of extract_programmer_param_str()
Results can be reproduced with the following invocation;
```
$ find -name '*.c' -exec sed -i 's/extract_programmer_param_str(/extract_programmer_param_str(NULL, /g' '{}' \;
```
This allows for a pointer to the actual programmer parameters
to be passed instead of a global.
Change-Id: I781a328fa280e0a9601050dd99a75af72c39c899
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66654
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r-- | ft2232_spi.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ft2232_spi.c b/ft2232_spi.c index bbacc03b..7c310132 100644 --- a/ft2232_spi.c +++ b/ft2232_spi.c @@ -340,7 +340,7 @@ static int ft2232_spi_init(void) struct ftdi_context ftdic; struct ft2232_data *spi_data; - arg = extract_programmer_param_str("type"); + arg = extract_programmer_param_str(NULL, "type"); if (arg) { if (!strcasecmp(arg, "2232H")) { ft2232_type = FTDI_FT2232H_PID; @@ -447,7 +447,7 @@ static int ft2232_spi_init(void) /* Remember reserved pins before pindir gets modified. */ const uint8_t rsv_bits = pindir & 0xf0; - arg = extract_programmer_param_str("port"); + arg = extract_programmer_param_str(NULL, "port"); if (arg) { switch (toupper((unsigned char)*arg)) { case 'A': @@ -480,7 +480,7 @@ static int ft2232_spi_init(void) } free(arg); - arg = extract_programmer_param_str("divisor"); + arg = extract_programmer_param_str(NULL, "divisor"); if (arg && strlen(arg)) { unsigned int temp = 0; char *endptr; @@ -496,7 +496,7 @@ static int ft2232_spi_init(void) free(arg); bool csgpiol_set = false; - arg = extract_programmer_param_str("csgpiol"); + arg = extract_programmer_param_str(NULL, "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(void) 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(gpiol_param); + arg = extract_programmer_param_str(NULL, 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("serial"); - arg2 = extract_programmer_param_str("description"); + arg = extract_programmer_param_str(NULL, "serial"); + arg2 = extract_programmer_param_str(NULL, "description"); f = ftdi_usb_open_desc(&ftdic, ft2232_vid, ft2232_type, arg2, arg); |