summaryrefslogtreecommitdiffstats
path: root/linux_spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-12-18 15:01:24 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2011-12-18 15:01:24 +0000
commit8a3c60cdd0e5632173567923ae1927763e31e857 (patch)
tree3a5514d022392cf4d8fa368f9f02653da21a93ca /linux_spi.c
parent63fd9026f1e82b67a65072fda862ba7af35839e1 (diff)
downloadflashrom-8a3c60cdd0e5632173567923ae1927763e31e857.tar.gz
flashrom-8a3c60cdd0e5632173567923ae1927763e31e857.tar.bz2
flashrom-8a3c60cdd0e5632173567923ae1927763e31e857.zip
Add struct flashctx * parameter to all functions accessing flash chips
All programmer access function prototypes except init have been made static and moved to the respective file. A few internal functions in flash chip drivers had chipaddr parameters which are no longer needed. The lines touched by flashctx changes have been adjusted to 80 columns except in header files. Corresponding to flashrom svn r1474. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'linux_spi.c')
-rw-r--r--linux_spi.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/linux_spi.c b/linux_spi.c
index 372082300..d99438988 100644
--- a/linux_spi.c
+++ b/linux_spi.c
@@ -34,8 +34,10 @@
static int fd = -1;
static int linux_spi_shutdown(void *data);
-static int linux_spi_send_command(unsigned int writecnt, unsigned int readcnt,
- const unsigned char *txbuf, unsigned char *rxbuf);
+static int linux_spi_send_command(struct flashctx *flash, unsigned int writecnt,
+ unsigned int readcnt,
+ const unsigned char *txbuf,
+ unsigned char *rxbuf);
static int linux_spi_read(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len);
static int linux_spi_write_256(struct flashctx *flash, uint8_t *buf,
@@ -107,8 +109,10 @@ static int linux_spi_shutdown(void *data)
return 0;
}
-static int linux_spi_send_command(unsigned int writecnt, unsigned int readcnt,
- const unsigned char *txbuf, unsigned char *rxbuf)
+static int linux_spi_send_command(struct flashctx *flash, unsigned int writecnt,
+ unsigned int readcnt,
+ const unsigned char *txbuf,
+ unsigned char *rxbuf)
{
struct spi_ioc_transfer msg[2] = {
{
@@ -134,11 +138,13 @@ static int linux_spi_send_command(unsigned int writecnt, unsigned int readcnt,
static int linux_spi_read(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len)
{
- return spi_read_chunked(flash, buf, start, len, (unsigned)getpagesize());
+ return spi_read_chunked(flash, buf, start, len,
+ (unsigned int)getpagesize());
}
static int linux_spi_write_256(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len)
{
- return spi_write_chunked(flash, buf, start, len, ((unsigned)getpagesize()) - 4);
+ return spi_write_chunked(flash, buf, start, len,
+ ((unsigned int)getpagesize()) - 4);
}