1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +02:00

programmer: Smoothen register_par_master API

It was impossible to register a const struct par_master that would
point to dynamically allocated `data`. Fix that so that we won't
have to create more mutable globals.

BUG=b:185191942
TEST=builds

Change-Id: I95bc92f6c54c5bcdac1c522ca87054aaffed0f40
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/54169
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
Anastasia Klimchuk
2021-05-21 09:40:58 +10:00
committed by Edward O'Callaghan
parent daa86b5301
commit 6a5db26e68
17 changed files with 21 additions and 17 deletions

View File

@ -81,7 +81,8 @@ void fallback_chip_readn(const struct flashctx *flash, uint8_t *buf,
}
int register_par_master(const struct par_master *mst,
const enum chipbustype buses)
const enum chipbustype buses,
void *data)
{
struct registered_master rmst = {0};
@ -96,6 +97,8 @@ int register_par_master(const struct par_master *mst,
rmst.buses_supported = buses;
rmst.par = *mst;
if (data)
rmst.par.data = data;
return register_master(&rmst);
}