summaryrefslogtreecommitdiffstats
path: root/spi.c
diff options
context:
space:
mode:
authorMark Marshall <mark.marshall@omicron.at>2014-05-09 21:16:21 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2014-05-09 21:16:21 +0000
commite6f4adf734badf740939a7e9b395e1e6deee4ae0 (patch)
tree6324be451385c9f9cea27381f35f300fbaa7f454 /spi.c
parent9a4efdadb2f72e9a99ca017f6ba90dbd8c5967f4 (diff)
downloadflashrom-e6f4adf734badf740939a7e9b395e1e6deee4ae0.zip
flashrom-e6f4adf734badf740939a7e9b395e1e6deee4ae0.tar.gz
Add 'const' keyword to chip write and other function prototypes
Inspired by and mostly based on a patch Corresponding to flashrom svn r1789. Signed-off-by: Mark Marshall <mark.marshall@omicron.at> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/spi.c b/spi.c
index 94a76a7..d6cbb88 100644
--- a/spi.c
+++ b/spi.c
@@ -88,8 +88,7 @@ int default_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int start,
return spi_read_chunked(flash, buf, start, len, max_data);
}
-int default_spi_write_256(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)
{
unsigned int max_data = flash->pgm->spi.max_data_write;
if (max_data == MAX_DATA_UNSPECIFIED) {
@@ -135,8 +134,7 @@ int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start,
* .write_256 = spi_chip_write_1
*/
/* real chunksize is up to 256, logical chunksize is 256 */
-int spi_chip_write_256(struct flashctx *flash, uint8_t *buf, unsigned int start,
- unsigned int len)
+int spi_chip_write_256(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
{
return flash->pgm->spi.write_256(flash, buf, start, len);
}
@@ -162,8 +160,7 @@ uint32_t spi_get_valid_read_addr(struct flashctx *flash)
}
}
-int spi_aai_write(struct flashctx *flash, uint8_t *buf,
- unsigned int start, unsigned int len)
+int spi_aai_write(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
{
return flash->pgm->spi.write_aai(flash, buf, start, len);
}
OpenPOWER on IntegriCloud