mtd: docg3: fix protection areas reading
authorRobert Jarzmik <robert.jarzmik@free.fr>
Sat, 19 Nov 2011 15:02:45 +0000 (16:02 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 9 Jan 2012 18:07:15 +0000 (18:07 +0000)
The protection areas boundaries were on 16bit registers, not
8bit. This is consistent with block numbers, which can
extend up to 4096 on bigger chips (and is 2048 on the
docg3).

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com>
Reviewed-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/docg3.c

index 8942a751342e5f9c70bb0aa92a9599729e9b37a6..5834e6e65d1c2b10988b339d61a38945f2da32ef 100644 (file)
@@ -852,13 +852,15 @@ static int dbg_protection_show(struct seq_file *s, void *p)
 {
        struct docg3 *docg3 = (struct docg3 *)s->private;
        int pos = 0;
-       int protect = doc_register_readb(docg3, DOC_PROTECTION);
-       int dps0 = doc_register_readb(docg3, DOC_DPS0_STATUS);
-       int dps0_low = doc_register_readb(docg3, DOC_DPS0_ADDRLOW);
-       int dps0_high = doc_register_readb(docg3, DOC_DPS0_ADDRHIGH);
-       int dps1 = doc_register_readb(docg3, DOC_DPS1_STATUS);
-       int dps1_low = doc_register_readb(docg3, DOC_DPS1_ADDRLOW);
-       int dps1_high = doc_register_readb(docg3, DOC_DPS1_ADDRHIGH);
+       int protect, dps0, dps0_low, dps0_high, dps1, dps1_low, dps1_high;
+
+       protect = doc_register_readb(docg3, DOC_PROTECTION);
+       dps0 = doc_register_readb(docg3, DOC_DPS0_STATUS);
+       dps0_low = doc_register_readw(docg3, DOC_DPS0_ADDRLOW);
+       dps0_high = doc_register_readw(docg3, DOC_DPS0_ADDRHIGH);
+       dps1 = doc_register_readb(docg3, DOC_DPS1_STATUS);
+       dps1_low = doc_register_readw(docg3, DOC_DPS1_ADDRLOW);
+       dps1_high = doc_register_readw(docg3, DOC_DPS1_ADDRHIGH);
 
        pos += seq_printf(s, "Protection = 0x%02x (",
                         protect);