mtd/drivers/mtd mtd_blkdevs-24.c,1.6,1.7

David Woodhouse dwmw2 at infradead.org
Wed May 21 03:53:46 EDT 2003


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

Modified Files:
	mtd_blkdevs-24.c 
Log Message:
Don't register devfs subdir entries if there are partitions -- grok_partitions() seems to do that already

Index: mtd_blkdevs-24.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtd_blkdevs-24.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- mtd_blkdevs-24.c	21 May 2003 01:01:33 -0000	1.6
+++ mtd_blkdevs-24.c	21 May 2003 07:53:43 -0000	1.7
@@ -444,11 +444,11 @@
 		grok_partitions(&tr->blkcore_priv->gd, new->devnum,
 				1 << tr->part_bits, new->size);
 	}
-#ifdef CONFIG_DEVFS_FS 
-	{
+#ifdef CONFIG_DEVFS_FS
+	if (!tr->part_bits) {
 		char name[2];
 
-		name[0] = (tr->part_bits?'a':'0')+new->devnum;
+		name[0] = '0' + new->devnum;
 		name[1] = 0;
 
 		new->blkcore_priv = 
@@ -472,7 +472,10 @@
 	}
 
 #ifdef CONFIG_DEVFS_FS
-	devfs_unregister(old->blkcore_priv);
+	if (!tr->part_bits) {
+		devfs_unregister(old->blkcore_priv);
+		old->blkcore_priv = NULL;
+	}
 #endif
 	spin_lock(&tr->blkcore_priv->devs_lock);
 	list_del(&old->list);
@@ -567,7 +570,8 @@
 		return ret;
 	} 
 
-	tr->blkcore_priv->devfs_dir_handle = devfs_mk_dir(NULL, tr->name, NULL);
+	tr->blkcore_priv->devfs_dir_handle = 
+			devfs_mk_dir(NULL, tr->name, NULL);
 
 	blksize_size[tr->major] = tr->blkcore_priv->blksizes;
 	blk_size[tr->major] = tr->blkcore_priv->sizes;
@@ -616,8 +620,6 @@
 		tr->remove_dev(dev);
 	}
 
-	devfs_unregister(tr->blkcore_priv->devfs_dir_handle);
-
 	blksize_size[tr->major] = NULL;
 	blk_size[tr->major] = NULL;
 
@@ -625,6 +627,8 @@
 
 	blk_cleanup_queue(BLK_DEFAULT_QUEUE(tr->major));
 	devfs_unregister_blkdev(tr->major, tr->name);
+
+	devfs_unregister(tr->blkcore_priv->devfs_dir_handle);
 
 	up(&mtd_table_mutex);
 




More information about the linux-mtd-cvs mailing list