From 5a7cb847f096dacb0bf96b3aa909f79d76ae8204 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Sat, 25 Aug 2012 01:17:58 +0000 Subject: Make struct flashchip a field in struct flashctx instead of a complete copy All the driver conversion work and cleanup has been done by Stefan. flashrom.c and cli_classic.c are a joint work of Stefan and Carl-Daniel. Corresponding to flashrom svn r1579. Signed-off-by: Carl-Daniel Hailfinger Signed-off-by: Stefan Tauner Acked-by: Stefan Tauner Acked-by: Carl-Daniel Hailfinger --- stm50flw0x0x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stm50flw0x0x.c') diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c index 9b6443e5..e6c7c054 100644 --- a/stm50flw0x0x.c +++ b/stm50flw0x0x.c @@ -54,7 +54,7 @@ static int unlock_block_stm50flw0x0x(struct flashctx *flash, int offset) /* Check, if it's is a top/bottom-block with 4k-sectors. */ /* TODO: What about the other types? */ if ((offset == 0) || - (offset == (flash->model_id == ST_M50FLW080A ? 0xE0000 : 0x10000)) + (offset == (flash->chip->model_id == ST_M50FLW080A ? 0xE0000 : 0x10000)) || (offset == 0xF0000)) { // unlock each 4k-sector @@ -85,7 +85,7 @@ int unlock_stm50flw0x0x(struct flashctx *flash) { int i; - for (i = 0; i < flash->total_size * 1024; i+= flash->page_size) { + for (i = 0; i < flash->chip->total_size * 1024; i+= flash->chip->page_size) { if(unlock_block_stm50flw0x0x(flash, i)) { msg_cerr("UNLOCK FAILED!\n"); return -1; -- cgit v1.2.3