diff options
author | Peter Stuge <peter@stuge.se> | 2008-07-07 06:38:51 +0000 |
---|---|---|
committer | Peter Stuge <peter@stuge.se> | 2008-07-07 06:38:51 +0000 |
commit | a95bad733f21e6d71c9e0ed19d25a008fd6215a1 (patch) | |
tree | 83dc53759cd8cca1419c8e1e43dc3e83d15995f2 /it87spi.c | |
parent | f07cbe317ba12c00fb4265394f26c011047c91f7 (diff) | |
download | flashrom-a95bad733f21e6d71c9e0ed19d25a008fd6215a1.zip flashrom-a95bad733f21e6d71c9e0ed19d25a008fd6215a1.tar.gz |
Trivial SPI cleanups
While writing a new SPI driver I fixed some things in the SPI code:
All calls to spi_command() had unneccessary #define duplications, and in some
cases the read count define could theoretically become harmful because NULL was
passed for the read buffer. Avoid a crash, should someone change the #defines.
I also noticed that the only caller of spi_page_program() was the it87 driver,
and spi_page_program() could only call back into the it87 driver. Removed the
function for easier-to-follow code and made it8716f_spi_page_program() static.
The ichspi driver's static page functions are already static.
Corresponding to flashrom svn r302 and coreboot v2 svn r3418.
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Peter Stuge <peter@stuge.se>
Diffstat (limited to 'it87spi.c')
-rw-r--r-- | it87spi.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -192,7 +192,7 @@ int it8716f_spi_command(unsigned int writecnt, unsigned int readcnt, const unsig } /* Page size is usually 256 bytes */ -void it8716f_spi_page_program(int block, uint8_t *buf, uint8_t *bios) { +static void it8716f_spi_page_program(int block, uint8_t *buf, uint8_t *bios) { int i; spi_write_enable(); @@ -261,7 +261,7 @@ int it8716f_spi_chip_write(struct flashchip *flash, uint8_t *buf) { it8716f_over512k_spi_chip_write(flash, buf); } else { for (i = 0; i < total_size / 256; i++) { - spi_page_program(i, buf, (uint8_t *)flash->virtual_memory); + it8716f_spi_page_program(i, buf, (uint8_t *)flash->virtual_memory); } } return 0; |