1
0
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:
Edward O'Callaghan
2022-08-12 13:37:13 +10:00
committed by Anastasia Klimchuk
parent e316f1970d
commit 1233e63833
40 changed files with 53 additions and 51 deletions

View File

@ -47,7 +47,7 @@ struct programmer_entry {
const char *const note;
} devs;
int (*init) (void);
int (*init) (const struct programmer_cfg *cfg);
void *(*map_flash_region) (const char *descr, uintptr_t phys_addr, size_t len);
void (*unmap_flash_region) (void *virt_addr, size_t len);
@ -376,7 +376,7 @@ int init_superio_ite(void);
#if CONFIG_LINUX_MTD == 1
/* trivial wrapper to avoid cluttering internal_init() with #if */
static inline int try_mtd(void) { return programmer_linux_mtd.init(); };
static inline int try_mtd(void) { return programmer_linux_mtd.init(NULL); };
#else
static inline int try_mtd(void) { return 1; };
#endif