Skip to contentSkip to conversation

Bugfix in cfi_intelext_read_prot_reg

PATCH New Clive Davies 1 participant 1 message Sep 25, 2002 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bugfix in cfi_intelext_read_prot_reg

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

cfi_cmdset_0001.c 25 Sep 2002 09:46:16 -0000 renamed from cfi_cmdset_0001.c 13 Sep 2002 14:39:34 -0000 1.102 +1 -1
diff -u -p -r1.102 cfi_cmdset_0001.c
@@ -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--;