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/w39v040c.c b/w39v040c.c
index 66ab115..853419a 100644
--- a/w39v040c.c
+++ b/w39v040c.c
@@ -50,6 +50,32 @@
 	return 1;
 }
 
+int printlock_w39v040c(struct flashchip *flash)
+{
+	chipaddr bios = flash->virtual_memory;
+	uint8_t lock;
+
+	chip_writeb(0xAA, bios + 0x5555);
+	programmer_delay(10);
+	chip_writeb(0x55, bios + 0x2AAA);
+	programmer_delay(10);
+	chip_writeb(0x90, bios + 0x5555);
+	programmer_delay(10);
+
+	lock = chip_readb(bios + 0xfff2);
+
+	chip_writeb(0xAA, bios + 0x5555);
+	programmer_delay(10);
+	chip_writeb(0x55, bios + 0x2AAA);
+	programmer_delay(10);
+	chip_writeb(0xF0, bios + 0x5555);
+	programmer_delay(40);
+
+	printf("%s: Boot block #TBL is %slocked, rest of chip #WP is %slocked.\n",
+		__func__, lock & 0x4 ? "" : "un", lock & 0x8 ? "" : "un");
+	return 0;
+}
+
 int erase_w39v040c(struct flashchip *flash)
 {
 	int i;