mtd/drivers/mtd mtd_blkdevs.c,1.9,1.10

David Woodhouse dwmw2 at infradead.org
Tue May 20 17:31:56 EDT 2003


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

Modified Files:
	mtd_blkdevs.c 
Log Message:
Fix list bug, avoid MTD_ABSENT devices


Index: mtd_blkdevs.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtd_blkdevs.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- mtd_blkdevs.c	20 May 2003 14:36:21 -0000	1.9
+++ mtd_blkdevs.c	20 May 2003 21:31:53 -0000	1.10
@@ -361,7 +361,7 @@
 		struct mtd_blktrans_ops *tr = list_entry(this, struct mtd_blktrans_ops, list);
 
 		list_for_each_safe(this2, next, &tr->devs) {
-			struct mtd_blktrans_dev *dev = list_entry(this, struct mtd_blktrans_dev, list);
+			struct mtd_blktrans_dev *dev = list_entry(this2, struct mtd_blktrans_dev, list);
 
 			if (dev->mtd == mtd)
 				tr->remove_dev(dev);
@@ -373,6 +373,9 @@
 {
 	struct list_head *this;
 
+	if (mtd->type == MTD_ABSENT)
+		return;
+
 	list_for_each(this, &blktrans_majors) {
 		struct mtd_blktrans_ops *tr = list_entry(this, struct mtd_blktrans_ops, list);
 
@@ -415,7 +418,7 @@
 	list_add(&tr->list, &blktrans_majors);
 
 	for (i=0; i<MAX_MTD_DEVICES; i++) {
-		if (mtd_table[i])
+		if (mtd_table[i] && mtd_table[i]->type != MTD_ABSENT)
 			tr->add_mtd(tr, mtd_table[i]);
 	}
 




More information about the linux-mtd-cvs mailing list