summaryrefslogtreecommitdiffstats
path: root/m29f400bt.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-10-10 16:10:49 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-10-10 16:10:49 +0000
commit184b95f449e4c314964b63c3170da216267d3b5e (patch)
treef5df1cca0b51c3227a47aa5968c816abcba49682 /m29f400bt.c
parentb30a5ed4afead1592224009230ea23500f91b230 (diff)
downloadast2050-flashrom-184b95f449e4c314964b63c3170da216267d3b5e.zip
ast2050-flashrom-184b95f449e4c314964b63c3170da216267d3b5e.tar.gz
Simplify calls to inner write functions
No behavioural changes, just equivalence transformations. Corresponding to flashrom svn r1209. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'm29f400bt.c')
-rw-r--r--m29f400bt.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/m29f400bt.c b/m29f400bt.c
index 98e0762..e990d9d 100644
--- a/m29f400bt.c
+++ b/m29f400bt.c
@@ -142,18 +142,5 @@ int block_erase_chip_m29f400bt(struct flashchip *flash, unsigned int address, un
int write_m29f400bt(struct flashchip *flash, uint8_t *buf)
{
- int i;
- int total_size = flash->total_size * 1024;
- int page_size = flash->page_size;
-
- for (i = 0; i < (total_size / page_size) - 1; i++) {
- write_page_m29f400bt(flash, buf + i * page_size, i * page_size, page_size);
- }
-
- write_page_m29f400bt(flash, buf + 0x70000, 0x70000, 32 * 1024);
- write_page_m29f400bt(flash, buf + 0x78000, 0x78000, 8 * 1024);
- write_page_m29f400bt(flash, buf + 0x7a000, 0x7a000, 8 * 1024);
- write_page_m29f400bt(flash, buf + 0x7c000, 0x7c000, 16 * 1024);
-
- return 0;
+ return write_page_m29f400bt(flash, buf, 0, flash->total_size * 1024);
}
OpenPOWER on IntegriCloud