mtd/drivers/mtd/chips cfi_cmdset_0001.c,1.167,1.168

Nicolas Pitre nico at infradead.org
Thu Feb 17 15:35:04 EST 2005


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

Modified Files:
	cfi_cmdset_0001.c 
Log Message:
Make OTP actually work.
The OTP code is rather broken without this.


Index: cfi_cmdset_0001.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_cmdset_0001.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -r1.167 -r1.168
--- cfi_cmdset_0001.c	8 Feb 2005 17:11:15 -0000	1.167
+++ cfi_cmdset_0001.c	17 Feb 2005 20:34:59 -0000	1.168
@@ -2025,7 +2025,7 @@
 	map_word datum;
 
 	/* make sure area matches group boundaries */
-	if (offset != 0 || size != grpsz)
+	if (size != grpsz)
 		return -EXDEV;
 
 	datum = map_word_ff(map);
@@ -2089,7 +2089,7 @@
 				groupno = 0;
 			}
 
-			while (groups > 0) {
+			while (len > 0 && groups > 0) {
 				if (!action) {
 					/*
 					 * Special case: if action is NULL
@@ -2118,6 +2118,7 @@
 					*retlen += sizeof(*otpinfo);
 				} else if (from >= groupsize) {
 					from -= groupsize;
+					data_offset += groupsize;
 				} else {
 					int size = groupsize;
 					data_offset += from;
@@ -2133,6 +2134,7 @@
 					buf += size;
 					len -= size;
 					*retlen += size;
+					data_offset += size;
 				}
 				groupno++;
 				groups--;





More information about the linux-mtd-cvs mailing list