1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-06-30 21:52:36 +02:00

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>
This commit is contained in:
Edward O'Callaghan
2022-08-12 13:47:29 +10:00
committed by Anastasia Klimchuk
parent c3df94cb96
commit 5c710ea54a
30 changed files with 87 additions and 85 deletions

View File

@ -332,7 +332,7 @@ static int buspirate_spi_init(const struct programmer_cfg *cfg)
unsigned char *bp_commbuf;
int bp_commbufsize;
dev = extract_programmer_param_str(NULL, "dev");
dev = extract_programmer_param_str(cfg, "dev");
if (dev && !strlen(dev)) {
free(dev);
dev = NULL;
@ -342,7 +342,7 @@ static int buspirate_spi_init(const struct programmer_cfg *cfg)
return 1;
}
tmp = extract_programmer_param_str(NULL, "spispeed");
tmp = extract_programmer_param_str(cfg, "spispeed");
if (tmp) {
for (i = 0; spispeeds[i].name; i++) {
if (!strncasecmp(spispeeds[i].name, tmp, strlen(spispeeds[i].name))) {
@ -356,7 +356,7 @@ static int buspirate_spi_init(const struct programmer_cfg *cfg)
free(tmp);
/* Extract serialspeed parameter */
tmp = extract_programmer_param_str(NULL, "serialspeed");
tmp = extract_programmer_param_str(cfg, "serialspeed");
if (tmp) {
for (i = 0; serialspeeds[i].name; i++) {
if (!strncasecmp(serialspeeds[i].name, tmp, strlen(serialspeeds[i].name))) {
@ -369,7 +369,7 @@ static int buspirate_spi_init(const struct programmer_cfg *cfg)
}
free(tmp);
tmp = extract_programmer_param_str(NULL, "pullups");
tmp = extract_programmer_param_str(cfg, "pullups");
if (tmp) {
if (strcasecmp("on", tmp) == 0)
pullup = 1;
@ -380,7 +380,7 @@ static int buspirate_spi_init(const struct programmer_cfg *cfg)
}
free(tmp);
tmp = extract_programmer_param_str(NULL, "psus");
tmp = extract_programmer_param_str(cfg, "psus");
if (tmp) {
if (strcasecmp("on", tmp) == 0)
psu = 1;