[PATCH] Bugfix in cfi_intelext_read_prot_reg

Clive Davies cdavies at altera.com
Wed Sep 25 05:57:46 EDT 2002


This patch fixes a bug with the calculation of which byte to read from the 
protection regsietsr which are presennt in some Intel flash devices.

Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.102
diff -u -p -r1.102 cfi_cmdset_0001.c
--- cfi_cmdset_0001.c   13 Sep 2002 14:39:34 -0000      1.102
+++ cfi_cmdset_0001.c   25 Sep 2002 09:46:16 -0000
@@ -527,7 +527,7 @@ static int cfi_intelext_read_prot_reg (s

                cfi_send_gen_cmd(0x90, 0x55,chip->start, map, cfi, cfi->device_type, NULL);
                while(count && ((offst-base_offst)<reg_sz)){
-                       *buf=map->read8(map,(chip->start+(extp->ProtRegAddr*ofs_factor)+offst));
+                       *buf=map->read8(map,(chip->start+((extp->ProtRegAddr+1)*ofs_factor)+offst));
                        buf++;
                        offst++;
                        count--;





More information about the linux-mtd mailing list