summaryrefslogtreecommitdiffstats
path: root/pm49fl00x.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
commit9e15fce8945a4611343b083b94ed8d0de8d43c5f (patch)
tree3a5514d022392cf4d8fa368f9f02653da21a93ca /pm49fl00x.c
parent4303a77daaed729c507182667d0704a114c4b157 (diff)
downloadflashrom-9e15fce8945a4611343b083b94ed8d0de8d43c5f.zip
flashrom-9e15fce8945a4611343b083b94ed8d0de8d43c5f.tar.gz
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 'pm49fl00x.c')
-rw-r--r--pm49fl00x.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/pm49fl00x.c b/pm49fl00x.c
index 3f74758..42db2aa 100644
--- a/pm49fl00x.c
+++ b/pm49fl00x.c
@@ -22,28 +22,32 @@
#include "flash.h"
-static void write_lockbits_49fl00x(chipaddr bios, unsigned int size,
- unsigned char bits, unsigned int block_size)
+static void write_lockbits_49fl00x(const struct flashctx *flash,
+ unsigned int size, unsigned char bits,
+ unsigned int block_size)
{
unsigned int i, left = size;
+ chipaddr bios = flash->virtual_registers;
for (i = 0; left >= block_size; i++, left -= block_size) {
/* pm49fl002 */
if (block_size == 16384 && i % 2)
continue;
- chip_writeb(bits, bios + (i * block_size) + 2);
+ chip_writeb(flash, bits, bios + (i * block_size) + 2);
}
}
int unlock_49fl00x(struct flashctx *flash)
{
- write_lockbits_49fl00x(flash->virtual_registers, flash->total_size * 1024, 0, flash->page_size);
+ write_lockbits_49fl00x(flash, flash->total_size * 1024, 0,
+ flash->page_size);
return 0;
}
int lock_49fl00x(struct flashctx *flash)
{
- write_lockbits_49fl00x(flash->virtual_registers, flash->total_size * 1024, 1, flash->page_size);
+ write_lockbits_49fl00x(flash, flash->total_size * 1024, 1,
+ flash->page_size);
return 0;
}
OpenPOWER on IntegriCloud