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>
diff --git a/sst_fwhub.c b/sst_fwhub.c
index c802a33..a440a20 100644
--- a/sst_fwhub.c
+++ b/sst_fwhub.c
@@ -31,7 +31,7 @@
blockstatus = chip_readb(flash, registers + offset + 2);
msg_cdbg("Lock status for 0x%06x (size 0x%06x) is %02x, ",
- offset, flash->page_size, blockstatus);
+ offset, flash->chip->page_size, blockstatus);
switch (blockstatus & 0x3) {
case 0x0:
msg_cdbg("full access\n");
@@ -72,7 +72,7 @@
{
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)
check_sst_fwhub_block_lock(flash, i);
return 0;
@@ -82,7 +82,7 @@
{
int i, ret=0;
- 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 (clear_sst_fwhub_block_lock(flash, i))
{