mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-01 22:21:16 +02:00
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>
This commit is contained in:

committed by
Anastasia Klimchuk

parent
e316f1970d
commit
1233e63833
@ -116,7 +116,8 @@ static const struct par_master par_master_internal = {
|
||||
.chip_writen = fallback_chip_writen,
|
||||
};
|
||||
|
||||
static int get_params(int *boardenable, int *boardmismatch,
|
||||
static int get_params(const struct programmer_cfg *cfg,
|
||||
int *boardenable, int *boardmismatch,
|
||||
int *force_laptop, int *not_a_laptop,
|
||||
char **board_vendor, char **board_model)
|
||||
{
|
||||
@ -188,7 +189,7 @@ static int get_params(int *boardenable, int *boardmismatch,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int internal_init(void)
|
||||
static int internal_init(const struct programmer_cfg *cfg)
|
||||
{
|
||||
int ret = 0;
|
||||
int force_laptop;
|
||||
@ -200,7 +201,8 @@ static int internal_init(void)
|
||||
const char *cb_model = NULL;
|
||||
#endif
|
||||
|
||||
ret = get_params(&force_boardenable, &force_boardmismatch,
|
||||
ret = get_params(cfg,
|
||||
&force_boardenable, &force_boardmismatch,
|
||||
&force_laptop, ¬_a_laptop,
|
||||
&board_vendor, &board_model);
|
||||
if (ret)
|
||||
|
Reference in New Issue
Block a user