diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-08-12 13:37:13 +1000 |
---|---|---|
committer | Anastasia Klimchuk <aklm@chromium.org> | 2022-09-07 01:50:58 +0000 |
commit | 1233e638336f2d67be57b31bb769aa85aa5bd583 (patch) | |
tree | 4956b812498cfcc0d33e16a15620abb6be28a68a /mediatek_i2c_spi.c | |
parent | e316f1970d9c51ab167be0835a4cfbadf92e9653 (diff) | |
download | flashrom-1233e638336f2d67be57b31bb769aa85aa5bd583.tar.gz flashrom-1233e638336f2d67be57b31bb769aa85aa5bd583.tar.bz2 flashrom-1233e638336f2d67be57b31bb769aa85aa5bd583.zip |
tree: Allow passing programmer_cfg directly to programmer
Modify the type signature of each programmer entry-point
xxx_init() functions to allow for the consumption of the
programmer parameterisation string data.
```
$ find -name '*.c' -exec sed -i 's/_init(void)/_init(const char *prog_param)/g' '{}' \;
$ find -name '*.c' -exec sed -i 's/get_params(/get_params(const char *prog_param, /g' '{}' \;
$ find -name '*.c' -exec sed -i 's/const char \*prog_param)/const struct programmer_cfg *cfg)/g' '{}' \;
$ find -name '*.c' -exec sed -i 's/const char \*prog_param,/const struct programmer_cfg *cfg,/g' '{}' \;
```
and manually fix up any remaining parts.
Change-Id: I8bab51a635b9d3a43e1619a7a32b334f4ce2cdd2
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/66655
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 'mediatek_i2c_spi.c')
-rw-r--r-- | mediatek_i2c_spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mediatek_i2c_spi.c b/mediatek_i2c_spi.c index 4133edbc..c460da18 100644 --- a/mediatek_i2c_spi.c +++ b/mediatek_i2c_spi.c @@ -464,7 +464,7 @@ static const struct spi_master spi_master_i2c_mediatek = { .probe_opcode = default_spi_probe_opcode, }; -static int get_params(bool *allow_brick) +static int get_params(const struct programmer_cfg *cfg, bool *allow_brick) { char *brick_str = NULL; int ret = 0; @@ -484,12 +484,12 @@ static int get_params(bool *allow_brick) return ret; } -static int mediatek_init(void) +static int mediatek_init(const struct programmer_cfg *cfg) { int ret; bool allow_brick; - if (get_params(&allow_brick)) + if (get_params(cfg, &allow_brick)) return SPI_GENERIC_ERROR; /* |