mtd/drivers/mtd/devices block2mtd.c,1.3,1.4

joern at infradead.org joern at infradead.org
Wed Dec 22 08:06:00 EST 2004


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/home/joern/mtd/drivers/mtd/devices

Modified Files:
	block2mtd.c 
Log Message:
Move/change the init and exit functions.



Index: block2mtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/block2mtd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- block2mtd.c	22 Dec 2004 13:05:31 -0000	1.3
+++ block2mtd.c	22 Dec 2004 13:05:57 -0000	1.4
@@ -534,25 +534,6 @@
 	return NULL;
 }
 
-
-/* Cleanup and exit - sync the device and kill of the kernel thread */
-static void __devexit cleanup_blkmtd(void)
-{
-	struct list_head *temp1, *temp2;
-
-	/* Remove the MTD devices */
-	list_for_each_safe(temp1, temp2, &blkmtd_device_list) {
-		struct blkmtd_dev *dev = list_entry(temp1, struct blkmtd_dev,
-						    list);
-		blkmtd_sync(&dev->mtd_info);
-		del_mtd_device(&dev->mtd_info);
-		info("mtd%d: [%s] removed", dev->mtd_info.index,
-		     dev->mtd_info.name + strlen("blkmtd: "));
-		list_del(&dev->list);
-		free_device(dev);
-	}
-}
-
 #ifndef MODULE
 
 /* Handle kernel boot params */
@@ -599,26 +580,44 @@
 #endif
 
 
-/* Startup */
-static int __init init_blkmtd(void)
+static int __init blockmtd_init(void)
 {
 	int i;
 
 	info("version " VERSION);
-	/* Check args - device[0] is the bare minimum*/
-	if(!device[0]) {
+	/* Check args - device[0] is the bare minimum */
+	if (!device[0]) {
 		err("error: missing `device' name\n");
 		return -EINVAL;
 	}
 
-	for(i = 0; i < MAX_DEVICES; i++)
+	for (i = 0; i < MAX_DEVICES; i++)
 		add_device(device[i], erasesz[i] << 10);
 
-	if(list_empty(&blkmtd_device_list))
+	if (list_empty(&blkmtd_device_list))
 		return -EINVAL;
 
 	return 0;
 }
 
-module_init(init_blkmtd);
-module_exit(cleanup_blkmtd);
+
+static void __devexit blockmtd_exit(void)
+{
+	struct list_head *temp1, *temp2;
+
+	/* Remove the MTD devices */
+	list_for_each_safe(temp1, temp2, &blkmtd_device_list) {
+		struct blkmtd_dev *dev = list_entry(temp1, struct blkmtd_dev,
+						    list);
+		blkmtd_sync(&dev->mtd_info);
+		del_mtd_device(&dev->mtd_info);
+		info("mtd%d: [%s] removed", dev->mtd_info.index,
+				dev->mtd_info.name + strlen("blkmtd: "));
+		list_del(&dev->list);
+		free_device(dev);
+	}
+}
+
+
+module_init(blockmtd_init);
+module_exit(blockmtd_exit);





More information about the linux-mtd-cvs mailing list