aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
authorRobert Jarzmik <robert.jarzmik@free.fr>2011-11-19 10:02:45 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:07:15 -0500
commitdbc26d98f8b4a3d1d2f25d997a0a0aba4ea46add (patch)
tree429855f31d3176fb5b15f4d7c7d9b6bdfdc18b79 /drivers/mtd/devices
parent84a930581ef45e81cff0450b19ce5a70f24d50bb (diff)
mtd: docg3: fix protection areas reading
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>
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/docg3.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 8942a751342e..5834e6e65d1c 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -852,13 +852,15 @@ static int dbg_protection_show(struct seq_file *s, void *p)
852{ 852{
853 struct docg3 *docg3 = (struct docg3 *)s->private; 853 struct docg3 *docg3 = (struct docg3 *)s->private;
854 int pos = 0; 854 int pos = 0;
855 int protect = doc_register_readb(docg3, DOC_PROTECTION); 855 int protect, dps0, dps0_low, dps0_high, dps1, dps1_low, dps1_high;
856 int dps0 = doc_register_readb(docg3, DOC_DPS0_STATUS); 856
857 int dps0_low = doc_register_readb(docg3, DOC_DPS0_ADDRLOW); 857 protect = doc_register_readb(docg3, DOC_PROTECTION);
858 int dps0_high = doc_register_readb(docg3, DOC_DPS0_ADDRHIGH); 858 dps0 = doc_register_readb(docg3, DOC_DPS0_STATUS);
859 int dps1 = doc_register_readb(docg3, DOC_DPS1_STATUS); 859 dps0_low = doc_register_readw(docg3, DOC_DPS0_ADDRLOW);
860 int dps1_low = doc_register_readb(docg3, DOC_DPS1_ADDRLOW); 860 dps0_high = doc_register_readw(docg3, DOC_DPS0_ADDRHIGH);
861 int dps1_high = doc_register_readb(docg3, DOC_DPS1_ADDRHIGH); 861 dps1 = doc_register_readb(docg3, DOC_DPS1_STATUS);
862 dps1_low = doc_register_readw(docg3, DOC_DPS1_ADDRLOW);
863 dps1_high = doc_register_readw(docg3, DOC_DPS1_ADDRHIGH);
862 864
863 pos += seq_printf(s, "Protection = 0x%02x (", 865 pos += seq_printf(s, "Protection = 0x%02x (",
864 protect); 866 protect);