Here's a very quick patch to fix the missing unlock code
Fixes missing unlock for certain chips:
* unlock_49lf00x
* Pm49fl002
* Pm49fl004
* unlock_49flxxxc
* SST49LF160C
* unlock_winbond_fwhub
* W39V080FA
* W39V080FA (dual mode)
Fixes missing printlock for certain chip:
* printlock_w39v040c
* W39V040C
Corresponding to flashrom svn r907.
Signed-off-by: Sean Nelson <audiohacked@gmail.com>
Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
diff --git a/flashrom.c b/flashrom.c
index b8de3c1..d67680a 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -838,6 +838,9 @@
flash->vendor, flash->name, flash->total_size,
flashbuses_to_text(flash->bustype), base);
+ if (flash->printlock)
+ flash->printlock(flash);
+
return flash;
}
@@ -1147,12 +1150,18 @@
fprintf(stderr, "Continuing anyway.\n");
}
}
+ if (flash->unlock)
+ flash->unlock(flash);
+
if (erase_flash(flash)) {
emergency_help_message();
programmer_shutdown();
return 1;
}
} else if (read_it) {
+ if (flash->unlock)
+ flash->unlock(flash);
+
if (read_flash(flash, filename)) {
programmer_shutdown();
return 1;
@@ -1160,6 +1169,9 @@
} else {
struct stat image_stat;
+ if (flash->unlock)
+ flash->unlock(flash);
+
if (flash->tested & TEST_BAD_ERASE) {
fprintf(stderr, "Erase is not working on this chip "
"and erase is needed for write. ");