Aarya has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/70306 )
Change subject: spi.c: Make parameter (struct flashctx *) const ......................................................................
spi.c: Make parameter (struct flashctx *) const
Make (struct flashctx *) -> (const struct flashctx *) in probe_opcode functions.
Change-Id: Ied840dbbcbe50e44cabd32eea37b7257b5e9c957 Signed-off-by: Aarya Chaumal aarya.chaumal@gmail.com --- M dummyflasher.c M ichspi.c M include/programmer.h M spi.c 4 files changed, 18 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/06/70306/1
diff --git a/dummyflasher.c b/dummyflasher.c index 35cdfef..ca744f8 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -122,7 +122,7 @@ emu_data->spi_write_256_chunksize); }
-static bool dummy_spi_probe_opcode(struct flashctx *flash, uint8_t opcode) +static bool dummy_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode) { size_t i; struct emu_data *emu_data = flash->mst->spi.data; diff --git a/ichspi.c b/ichspi.c index 62d1799..4588502 100644 --- a/ichspi.c +++ b/ichspi.c @@ -1661,7 +1661,7 @@ return ret; }
-static bool ich_spi_probe_opcode(struct flashctx *flash, uint8_t opcode) +static bool ich_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode) { return find_opcode(curopcodes, opcode) >= 0; } diff --git a/include/programmer.h b/include/programmer.h index 55e300a..16448ea 100644 --- a/include/programmer.h +++ b/include/programmer.h @@ -312,7 +312,7 @@ 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); int (*shutdown)(void *data); - bool (*probe_opcode)(struct flashctx *flash, uint8_t opcode); + bool (*probe_opcode)(const struct flashctx *flash, uint8_t opcode); void *data; };
@@ -322,7 +322,7 @@ int default_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); int default_spi_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); int default_spi_write_aai(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len); -bool default_spi_probe_opcode(struct flashctx *flash, uint8_t opcode); +bool default_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode); int register_spi_master(const struct spi_master *mst, void *data);
/* The following enum is needed by ich_descriptor_tool and ich* code as well as in chipset_enable.c. */ diff --git a/spi.c b/spi.c index 26be8c7..93ef1af 100644 --- a/spi.c +++ b/spi.c @@ -134,7 +134,7 @@ return flash->mst->spi.write_aai(flash, buf, start, len); }
-bool default_spi_probe_opcode(struct flashctx *flash, uint8_t opcode) +bool default_spi_probe_opcode(const struct flashctx *flash, uint8_t opcode) { return true; }