summaryrefslogtreecommitdiffstats
path: root/w39v040c.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-12 15:38:55 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-05-12 15:38:55 +0000
commit01624f40eeec33c546150a240f194f057f6dd36e (patch)
tree5ef84e3f82ae6d3d7643bc85faafe63eff3256a9 /w39v040c.c
parent24f9fbe075107b58a2729a8f5d7da346ebe730e6 (diff)
downloadast2050-flashrom-01624f40eeec33c546150a240f194f057f6dd36e.zip
ast2050-flashrom-01624f40eeec33c546150a240f194f057f6dd36e.tar.gz
Use helper functions chip_{read,write}[bwl] to access flash chips
The semantic patch I used in r418 to make the original conversion to accessor functions was missing one isomorphism: a[b] <=> *(a+b) The semantic patcher Coccinelle was used to create this patch. Semantic patch follows: @@ typedef uint8_t; expression a; volatile uint8_t *b; @@ - b[a] + *(b + a) @@ expression a; volatile uint8_t *b; @@ - *(b) = (a); + chip_writeb(a, b); @@ volatile uint8_t *b; @@ - *(b) + chip_readb(b) @@ type T; T b; @@ ( chip_readb | chip_writeb ) (..., - (T) - (b) + b ) Corresponding to flashrom svn r498. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'w39v040c.c')
-rw-r--r--w39v040c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/w39v040c.c b/w39v040c.c
index f631d33..e7a2eb1 100644
--- a/w39v040c.c
+++ b/w39v040c.c
@@ -67,8 +67,8 @@ int erase_w39v040c(struct flashchip *flash)
erase_sector_jedec(flash->virtual_memory, i);
for (i = 0; i < total_size; i++)
- if (0xff != bios[i]) {
- printf("ERASE FAILED at 0x%08x! Expected=0xff, Read=0x%02x\n", i, bios[i]);
+ if (0xff != chip_readb(bios + i)) {
+ printf("ERASE FAILED at 0x%08x! Expected=0xff, Read=0x%02x\n", i, chip_readb(bios + i));
return -1;
}
OpenPOWER on IntegriCloud