1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 22:21:16 +02:00

tree/: Drop const from opaque data ptr in master definitions [alt]

The opaque data pointer need not necessarily have constant
data for the life-time of the specific master. This is because
the data field purpose is for the master to use as it sees fit
for managing its own internal state and therefore we should not
constrain this as being RO data at init time.

BUG=none
BRANCH=none
TEST=builds

Change-Id: I686c3c79547e35d48f3fd0b524fc98c176dcea6e
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/49131
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
This commit is contained in:
Edward O'Callaghan
2021-01-06 14:10:52 +11:00
committed by Edward O'Callaghan
parent 4f112f6994
commit ec94250066
2 changed files with 15 additions and 8 deletions

View File

@ -634,7 +634,7 @@ struct spi_master {
int (*read)(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int (*write_256)(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*write_aai)(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
const void *data;
void *data;
};
int default_spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt,
@ -722,7 +722,7 @@ struct opaque_master {
int (*read) (struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len);
int (*write) (struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len);
int (*erase) (struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen);
const void *data;
void *data;
};
int register_opaque_master(const struct opaque_master *mst);
@ -745,7 +745,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);
const void *data;
void *data;
};
int register_par_master(const struct par_master *mst, const enum chipbustype buses);
struct registered_master {