mtd/drivers/mtd mtdcore.c,1.36,1.37

David Woodhouse dwmw2 at infradead.org
Tue May 20 11:37:44 EDT 2003


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

Modified Files:
	mtdcore.c 
Log Message:
Remove __get_mtd_device

Index: mtdcore.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdcore.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- mtdcore.c	15 May 2003 17:00:07 -0000	1.36
+++ mtdcore.c	20 May 2003 15:37:41 -0000	1.37
@@ -24,8 +24,14 @@
 
 #include <linux/mtd/mtd.h>
 
-static DECLARE_MUTEX(mtd_table_mutex);
-static struct mtd_info *mtd_table[MAX_MTD_DEVICES];
+/* These are exported solely for the purpose of mtd_blkdevs.c. You 
+   should not use them for _anything_ else */
+DECLARE_MUTEX(mtd_table_mutex);
+struct mtd_info *mtd_table[MAX_MTD_DEVICES];
+
+EXPORT_SYMBOL_GPL(mtd_table_mutex);
+EXPORT_SYMBOL_GPL(mtd_table);
+
 static LIST_HEAD(mtd_notifiers);
 
 /**
@@ -170,7 +176,7 @@
 
 
 /**
- *	___get_mtd_device - obtain a validated handle for an MTD device
+ *	get_mtd_device - obtain a validated handle for an MTD device
  *	@mtd: last known address of the required MTD device
  *	@num: internal device number of the required MTD device
  *
@@ -178,11 +184,10 @@
  *	table, if any.	Given an address and num == -1, search the device table
  *	for a device with that address and return if it's still present. Given
  *	both, return the num'th driver only if its address matches. Return NULL
- *	if not. get_mtd_device() increases the use count, but
- *	__get_mtd_device() doesn't - you should generally use get_mtd_device().
+ *	if not.
  */
 	
-struct mtd_info *___get_mtd_device(struct mtd_info *mtd, int num, int count)
+struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num)
 {
 	struct mtd_info *ret = NULL;
 	int i;
@@ -198,13 +203,13 @@
 		if (mtd && mtd != ret)
 			ret = NULL;
 	}
-	if (count) {
-		if (ret && !try_module_get(ret->owner))
-			ret = NULL;
-	
-		if (ret)
-			ret->usecount++;
-	}
+
+	if (ret && !try_module_get(ret->owner))
+		ret = NULL;
+
+	if (ret)
+		ret->usecount++;
+
 	up(&mtd_table_mutex);
 	return ret;
 }
@@ -283,7 +288,7 @@
 
 EXPORT_SYMBOL(add_mtd_device);
 EXPORT_SYMBOL(del_mtd_device);
-EXPORT_SYMBOL(___get_mtd_device);
+EXPORT_SYMBOL(get_mtd_device);
 EXPORT_SYMBOL(put_mtd_device);
 EXPORT_SYMBOL(register_mtd_user);
 EXPORT_SYMBOL(unregister_mtd_user);




More information about the linux-mtd-cvs mailing list