Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/67894 )
Change subject: buspirate_spi.c: Move variable `psu` into parameter struct ......................................................................
buspirate_spi.c: Move variable `psu` into parameter struct
Signed-off-by: Felix Singer felixsinger@posteo.net Change-Id: I928af8450734473cdf1c07796b6c57c328d587d5 --- M buspirate_spi.c 1 file changed, 14 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/94/67894/1
diff --git a/buspirate_spi.c b/buspirate_spi.c index 1abb9ec..740e6b9 100644 --- a/buspirate_spi.c +++ b/buspirate_spi.c @@ -319,6 +319,7 @@ char *dev; int spispeed; bool pullup; + bool psu; };
static int buspirate_spi_init(const struct programmer_cfg *cfg) @@ -332,7 +333,6 @@ unsigned int hw_version_minor = 0; int serialspeed_index = -1; int ret = 0; - bool psu = false; unsigned char *bp_commbuf; int bp_commbufsize; struct buspirate_spi_parameters parameters = { 0 }; @@ -390,10 +390,11 @@ free(tmp); }
+ parameters.psu = false; tmp = extract_programmer_param_str(cfg, "psus"); if (tmp) { if (strcasecmp("on", tmp) == 0) - psu = true; + parameters.psu = true; else if (strcasecmp("off", tmp) == 0) ; // ignore else @@ -661,7 +662,7 @@ bp_commbuf[0] |= (1 << 2); msg_pdbg("Enabling pull-up resistors.\n"); } - if (psu) { + if (parameters.psu) { bp_commbuf[0] |= (1 << 3); msg_pdbg("Enabling PSUs.\n"); }