mtd: docg3: fix protection areas reading

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Jan 9 13:59:03 EST 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=dbc26d98f8b4a3d1d2f25d997a0a0aba4ea46add
Commit:     dbc26d98f8b4a3d1d2f25d997a0a0aba4ea46add
Parent:     84a930581ef45e81cff0450b19ce5a70f24d50bb
Author:     Robert Jarzmik <robert.jarzmik at free.fr>
AuthorDate: Sat Nov 19 16:02:45 2011 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Mon Jan 9 18:07:15 2012 +0000

    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 at free.fr>
    Reviewed-by: Ivan Djelic <ivan.djelic at parrot.com>
    Reviewed-by: Mike Dunn <mikedunn at newsguy.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/devices/docg3.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index 8942a75..5834e6e 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)
 {
 	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);



More information about the linux-mtd-cvs mailing list