summaryrefslogtreecommitdiffstats
path: root/stm50flw0x0x.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-25 01:17:58 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-25 01:17:58 +0000
commit5a7cb847f096dacb0bf96b3aa909f79d76ae8204 (patch)
treeda511e990c1fdded61ee5dcefae38314c3a5a6cc /stm50flw0x0x.c
parentdd73d830f7370b5f0bbdaa0780b0ff8d6ff1776a (diff)
downloadflashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.tar.gz
flashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.tar.bz2
flashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.zip
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 <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'stm50flw0x0x.c')
-rw-r--r--stm50flw0x0x.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stm50flw0x0x.c b/stm50flw0x0x.c
index 9b6443e50..e6c7c0546 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;