mtd/drivers/mtd/chips cfi_util.c,1.7,1.8

Nicolas Pitre nico at infradead.org
Tue Dec 14 14:56:00 EST 2004


Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv31124/drivers/mtd/chips

Modified Files:
	cfi_util.c 
Log Message:
Increase region info and chip instance independently from each other.
Someone tried to be clever with chip masking here...
But it breaks with L18 flash where the chip structures are "virtual"
chips not real ones.


Index: cfi_util.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_util.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cfi_util.c	5 Nov 2004 22:41:05 -0000	1.7
+++ cfi_util.c	14 Dec 2004 19:55:56 -0000	1.8
@@ -165,7 +165,6 @@
 	i=first;
 
 	while(len) {
-		unsigned long chipmask;
 		int size = regions[i].erasesize;
 
 		ret = (*frob)(map, &cfi->chips[chipnum], adr, size, thunk);
@@ -174,10 +173,10 @@
 			return ret;
 
 		adr += size;
+		ofs += size;
 		len -= size;
 
-		chipmask = (1 << cfi->chipshift) - 1;
-		if ((adr & chipmask) == ((regions[i].offset + size * regions[i].numblocks) & chipmask))
+		if (ofs == regions[i].offset + size * regions[i].numblocks)
 			i++;
 
 		if (adr >> cfi->chipshift) {





More information about the linux-mtd-cvs mailing list