mtd/drivers/mtd mtdconcat.c,1.5,1.6

David Woodhouse dwmw2 at infradead.org
Wed Jun 25 08:37:52 EDT 2003


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

Modified Files:
	mtdconcat.c 
Log Message:
Don't pretend to have {read,write}_{oob,ecc} functions if subdevices don't

Index: mtdconcat.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdconcat.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- mtdconcat.c	25 Jun 2003 12:21:16 -0000	1.5
+++ mtdconcat.c	25 Jun 2003 12:37:50 -0000	1.6
@@ -675,6 +675,14 @@
 	concat->mtd.oobsize = subdev[0]->oobsize;
 	concat->mtd.ecctype = subdev[0]->ecctype;
 	concat->mtd.eccsize = subdev[0]->eccsize;
+	if (subdev[0]->read_ecc)
+		concat->mtd.read_ecc = concat_read_ecc;
+	if (subdev[0]->write_ecc)
+		concat->mtd.write_ecc = concat_write_ecc;
+	if (subdev[0]->read_oob)
+		concat->mtd.read_oob = concat_read_oob;
+	if (subdev[0]->write_oob)
+		concat->mtd.write_oob = concat_write_oob;
 
 	concat->subdev[0] = subdev[0];
 
@@ -706,7 +714,11 @@
 		if (concat->mtd.oobblock != subdev[i]->oobblock ||
 		    concat->mtd.oobsize != subdev[i]->oobsize ||
 		    concat->mtd.ecctype != subdev[i]->ecctype ||
-		    concat->mtd.eccsize != subdev[i]->eccsize) {
+		    concat->mtd.eccsize != subdev[i]->eccsize ||
+		    !concat->mtd.read_ecc != !concat->mtd.read_ecc ||
+		    !concat->mtd.write_ecc != !concat->mtd.write_ecc ||
+		    !concat->mtd.read_oob != !concat->mtd.read_oob ||
+		    !concat->mtd.write_oob != !concat->mtd.write_oob) {
 			kfree(concat);
 			printk("Incompatible OOB or ECC data on \"%s\"\n",
 			       subdev[i]->name);
@@ -727,10 +739,6 @@
 	concat->mtd.erase = concat_erase;
 	concat->mtd.read = concat_read;
 	concat->mtd.write = concat_write;
-	concat->mtd.read_ecc = concat_read_ecc;
-	concat->mtd.write_ecc = concat_write_ecc;
-	concat->mtd.read_oob = concat_read_oob;
-	concat->mtd.write_oob = concat_write_oob;
 	concat->mtd.sync = concat_sync;
 	concat->mtd.lock = concat_lock;
 	concat->mtd.unlock = concat_unlock;




More information about the linux-mtd-cvs mailing list