summaryrefslogtreecommitdiffstats
path: root/spi25.c
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2011-09-18 22:42:18 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2011-09-18 22:42:18 +0000
commit4d1ada86ce8524ca52271d4f7afeafd0a5e93c25 (patch)
tree2f3c43a3589edc55e7143b39d40df4a0cd039183 /spi25.c
parent370f3bc1ea02bfc326eee5ae2dcaa75474fd9308 (diff)
downloadflashrom-4d1ada86ce8524ca52271d4f7afeafd0a5e93c25.zip
flashrom-4d1ada86ce8524ca52271d4f7afeafd0a5e93c25.tar.gz
Revert "Unsignify lengths and addresses in chip functions and structs"
- probe_timing was changed to unsigned although we use negative values for special cases - some code was not changed along hence did no longer compile: * dediprog's read and write functions * linux_spi's read and write functions - it introduced a number of new sign conversion warnings (http://paste.flashrom.org/view.php?id=832) To be safe this patch reverts all changes made in r1448, a corrected patch will follow later. Thanks to idwer for pointing out the problem first! Corresponding to flashrom svn r1450. Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'spi25.c')
-rw-r--r--spi25.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/spi25.c b/spi25.c
index 444a8b6..937ee5d 100644
--- a/spi25.c
+++ b/spi25.c
@@ -844,7 +844,7 @@ int spi_write_status_register(struct flashchip *flash, int status)
return ret;
}
-int spi_byte_program(unsigned int addr, uint8_t databyte)
+int spi_byte_program(int addr, uint8_t databyte)
{
int result;
struct spi_command cmds[] = {
@@ -879,7 +879,7 @@ int spi_byte_program(unsigned int addr, uint8_t databyte)
return result;
}
-int spi_nbyte_program(unsigned int addr, uint8_t *bytes, unsigned int len)
+int spi_nbyte_program(int addr, uint8_t *bytes, int len)
{
int result;
/* FIXME: Switch to malloc based on len unless that kills speed. */
@@ -954,7 +954,7 @@ int spi_disable_blockprotect(struct flashchip *flash)
return 0;
}
-int spi_nbyte_read(unsigned int address, uint8_t *bytes, unsigned int len)
+int spi_nbyte_read(int address, uint8_t *bytes, int len)
{
const unsigned char cmd[JEDEC_READ_OUTSIZE] = {
JEDEC_READ,
@@ -972,7 +972,7 @@ int spi_nbyte_read(unsigned int address, uint8_t *bytes, unsigned int len)
* FIXME: Use the chunk code from Michael Karcher instead.
* Each page is read separately in chunks with a maximum size of chunksize.
*/
-int spi_read_chunked(struct flashchip *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize)
+int spi_read_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize)
{
int rc = 0;
int i, j, starthere, lenhere;
@@ -1012,7 +1012,7 @@ int spi_read_chunked(struct flashchip *flash, uint8_t *buf, unsigned int start,
* FIXME: Use the chunk code from Michael Karcher instead.
* Each page is written separately in chunks with a maximum size of chunksize.
*/
-int spi_write_chunked(struct flashchip *flash, uint8_t *buf, unsigned int start, unsigned int len, unsigned int chunksize)
+int spi_write_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize)
{
int rc = 0;
int i, j, starthere, lenhere;
@@ -1061,7 +1061,7 @@ int spi_write_chunked(struct flashchip *flash, uint8_t *buf, unsigned int start,
* (e.g. due to size constraints in IT87* for over 512 kB)
*/
/* real chunksize is 1, logical chunksize is 1 */
-int spi_chip_write_1(struct flashchip *flash, uint8_t *buf, unsigned int start, unsigned int len)
+int spi_chip_write_1(struct flashchip *flash, uint8_t *buf, int start, int len)
{
int i, result = 0;
@@ -1076,7 +1076,7 @@ int spi_chip_write_1(struct flashchip *flash, uint8_t *buf, unsigned int start,
return 0;
}
-int spi_aai_write(struct flashchip *flash, uint8_t *buf, unsigned int start, unsigned int len)
+int spi_aai_write(struct flashchip *flash, uint8_t *buf, int start, int len)
{
uint32_t pos = start;
int result;
OpenPOWER on IntegriCloud