mtd/drivers/mtd/nand nand.c,1.76,1.77

gleixner at infradead.org gleixner at infradead.org
Thu Apr 15 04:23:11 EDT 2004


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

Modified Files:
	nand.c 
Log Message:
fix wrong exit in verfiy_pages, add some debug info

Index: nand.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -u -r1.76 -r1.77
--- nand.c	14 Apr 2004 19:11:59 -0000	1.76
+++ nand.c	15 Apr 2004 08:23:08 -0000	1.77
@@ -735,7 +735,7 @@
 		page++;
 		numpages--;
 		if (!numpages)
-			goto out;
+			break;
 		
 		/* Apply delay or wait for ready/busy pin 
 		 * Do this before the AUTOINCR check, so no problems
@@ -910,7 +910,7 @@
 			 * This is the legacy mode. Used by YAFFS1
 			 */
 			if (oob_buf && oobsel->useecc != MTD_NANDECC_AUTOPLACE) { 
-				int *p = (int *)&oob_data[mtd->oobsize];
+				int *p = (int *)(&oob_data[mtd->oobsize]);
 				p[i] = ecc_status;
 			}
 			
@@ -1231,8 +1231,10 @@
 		 */
 		ret = nand_write_page (mtd, this, page, &oobbuf[oob], oobsel, 
 			(--numpages > 0));
-		if (ret)
+		if (ret) {
+			DEBUG (MTD_DEBUG_LEVEL0, "nand_write_ecc: write_page failed %d\n", ret);
 			goto out;
+		}	
 		/* Next oob page */
 		oob += mtd->oobsize;
 		/* Update written bytes count */
@@ -1253,8 +1255,10 @@
 			ret = nand_verify_pages (mtd, this, startpage, 
 				page - startpage,
 				oobbuf, oobsel, chipnr, (eccbuf != NULL));
-			if (ret)
+			if (ret) {
+				DEBUG (MTD_DEBUG_LEVEL0, "nand_write_ecc: verify_pages failed %d\n", ret);
 				goto out;
+			}	
 			*retlen = written;
 
 			ofs = autoplace ? mtd->oobavail : mtd->oobsize;
@@ -1279,9 +1283,10 @@
 	this->data_poi = bufstart;
  	ret = nand_verify_pages (mtd, this, startpage, totalpages,
 		oobbuf, oobsel, chipnr, (eccbuf != NULL));
-
 	if (!ret)
 		*retlen = written;
+	else	
+		DEBUG (MTD_DEBUG_LEVEL0, "nand_write_ecc: verify_pages failed %d\n", ret);
 
 out:
 	/* Deselect and wake up anyone waiting on the device */




More information about the linux-mtd-cvs mailing list