mtd/drivers/mtd/chips cfi_probe.c,1.81,1.82

Russell King rmk at infradead.org
Tue Nov 16 12:26:04 EST 2004


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

Modified Files:
	cfi_probe.c 
Log Message:
Avoid bus float issues causing misdetection of QRY string.


Index: cfi_probe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/cfi_probe.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- cfi_probe.c	5 Nov 2004 22:41:05 -0000	1.81
+++ cfi_probe.c	16 Nov 2004 17:26:01 -0000	1.82
@@ -76,25 +76,24 @@
 				struct cfi_private *cfi)
 {
 	int osf = cfi->interleave * cfi->device_type;	// scale factor
-	map_word val;
-	map_word qry;
+	map_word val[3];
+	map_word qry[3];
 
-	qry =  cfi_build_cmd('Q', map, cfi);
-	val = map_read(map, base + osf*0x10);
+	qry[0] = cfi_build_cmd('Q', map, cfi);
+	qry[1] = cfi_build_cmd('R', map, cfi);
+	qry[2] = cfi_build_cmd('Y', map, cfi);
+
+	val[0] = map_read(map, base + osf*0x10);
+	val[1] = map_read(map, base + osf*0x11);
+	val[2] = map_read(map, base + osf*0x12);
 
-	if (!map_word_equal(map, qry, val))
+	if (!map_word_equal(map, qry[0], val[0]))
 		return 0;
 
-	qry =  cfi_build_cmd('R', map, cfi);
-	val = map_read(map, base + osf*0x11);
-
-	if (!map_word_equal(map, qry, val))
+	if (!map_word_equal(map, qry[1], val[1]))
 		return 0;
 
-	qry =  cfi_build_cmd('Y', map, cfi);
-	val = map_read(map, base + osf*0x12);
-
-	if (!map_word_equal(map, qry, val))
+	if (!map_word_equal(map, qry[2], val[2]))
 		return 0;
 
 	return 1; 	// nothing found





More information about the linux-mtd-cvs mailing list