summaryrefslogtreecommitdiff
path: root/w39.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-08-25 01:17:58 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-08-25 01:17:58 +0000
commit913baf3ae389da095d36423d5ecb58ff453a2a85 (patch)
treeda511e990c1fdded61ee5dcefae38314c3a5a6cc /w39.c
parent7f03228e54d83bd61df4d937e93abbda797f9463 (diff)
downloadflashrom-913baf3ae389da095d36423d5ecb58ff453a2a85.tar.gz
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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@student.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1579 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'w39.c')
-rw-r--r--w39.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/w39.c b/w39.c
index 5f0c347..da61d23 100644
--- a/w39.c
+++ b/w39.c
@@ -138,11 +138,11 @@ static int printlock_w39_common(struct flashctx *flash, unsigned int offset)
static int printlock_w39_fwh(struct flashctx *flash)
{
- unsigned int i, total_size = flash->total_size * 1024;
+ unsigned int i, total_size = flash->chip->total_size * 1024;
int ret = 0;
/* Print lock status of the complete chip */
- for (i = 0; i < total_size; i += flash->page_size)
+ for (i = 0; i < total_size; i += flash->chip->page_size)
ret |= printlock_w39_fwh_block(flash, i);
return ret;
@@ -150,10 +150,10 @@ static int printlock_w39_fwh(struct flashctx *flash)
static int unlock_w39_fwh(struct flashctx *flash)
{
- unsigned int i, total_size = flash->total_size * 1024;
+ unsigned int i, total_size = flash->chip->total_size * 1024;
/* Unlock the complete chip */
- for (i = 0; i < total_size; i += flash->page_size)
+ for (i = 0; i < total_size; i += flash->chip->page_size)
if (unlock_w39_fwh_block(flash, i))
return -1;