mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 07:02:34 +02:00
par_master: Add shutdown function in par_master struct
With this, register_par_master can take care of register_shutdown as well, and every par master only needs to call register_par_master instead of calling both register_par_master and register_shutdown. Next patches in the chain convert par masters to use new API. BUG=b:185191942 TEST=builds and ninja test Change-Id: I0fee15d548cdd16678e551eeb351e659812ddf76 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/57154 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org>
This commit is contained in:
parent
822cc7ed2a
commit
d1697e9abe
@ -86,6 +86,13 @@ int register_par_master(const struct par_master *mst,
|
||||
{
|
||||
struct registered_master rmst = {0};
|
||||
|
||||
if (mst->shutdown) {
|
||||
if (register_shutdown(mst->shutdown, data)) {
|
||||
mst->shutdown(data); /* cleanup */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (!mst->chip_writeb || !mst->chip_writew || !mst->chip_writel ||
|
||||
!mst->chip_writen || !mst->chip_readb || !mst->chip_readw ||
|
||||
!mst->chip_readl || !mst->chip_readn) {
|
||||
|
@ -466,6 +466,7 @@ struct par_master {
|
||||
uint16_t (*chip_readw) (const struct flashctx *flash, const chipaddr addr);
|
||||
uint32_t (*chip_readl) (const struct flashctx *flash, const chipaddr addr);
|
||||
void (*chip_readn) (const struct flashctx *flash, uint8_t *buf, const chipaddr addr, size_t len);
|
||||
int (*shutdown)(void *data);
|
||||
void *data;
|
||||
};
|
||||
int register_par_master(const struct par_master *mst, const enum chipbustype buses, void *data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user