mtd/drivers/mtd/nand nand_base.c,1.138,1.139

dbrown at infradead.org dbrown at infradead.org
Mon Apr 4 14:02:26 EDT 2005


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

Modified Files:
	nand_base.c 
Log Message:
Version 1.137 broke nand_read_ecc clients who pass NULL oobsel.  Fixed.


Index: nand_base.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/nand/nand_base.c,v
retrieving revision 1.138
retrieving revision 1.139
diff -u -r1.138 -r1.139
--- nand_base.c	1 Apr 2005 07:21:44 -0000	1.138
+++ nand_base.c	4 Apr 2005 18:02:23 -0000	1.139
@@ -1090,8 +1090,8 @@
  * @len:	number of bytes to read
  * @retlen:	pointer to variable to store the number of read bytes
  * @buf:	the databuffer to put data
- * @oob_buf:	filesystem supplied oob data buffer
- * @oobsel:	oob selection structure
+ * @oob_buf:	filesystem supplied oob data buffer (can be NULL)
+ * @oobsel:	oob selection structure (can be NULL)
  * @flags:	flag to indicate if nand_get_device/nand_release_device should be preformed
  *		and how many corrected error bits are acceptable:
  *		  bits 0..7 - number of tolerable errors
@@ -1103,6 +1103,10 @@
 			     size_t * retlen, u_char * buf, u_char * oob_buf, 
 			     struct nand_oobinfo *oobsel, int flags)
 {
+	/* use userspace supplied oobinfo, if zero */
+	if (oobsel == NULL)
+		oobsel = &mtd->oobinfo;
+	
 	int i, j, col, realpage, page, end, ecc, chipnr, sndcmd = 1;
 	int read = 0, oob = 0, ecc_status = 0, ecc_failed = 0;
 	struct nand_chip *this = mtd->priv;
@@ -1130,10 +1134,6 @@
 	if (flags & NAND_GET_DEVICE)
 		nand_get_device (this, mtd, FL_READING);
 
-	/* use userspace supplied oobinfo, if zero */
-	if (oobsel == NULL)
-		oobsel = &mtd->oobinfo;
-	
 	/* Autoplace of oob data ? Use the default placement scheme */
 	if (oobsel->useecc == MTD_NANDECC_AUTOPLACE)
 		oobsel = this->autooob;





More information about the linux-mtd-cvs mailing list