kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [KJ] [Patch] convert mtd/chips/cfi* to symbol_put functions
@ 2006-03-24  9:58 Eric Sesterhenn
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn @ 2006-03-24  9:58 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 4892 bytes --]

hi,

since there are no flames yet for the other patch, i try
my luck again. I am happy about comments, but am afk
for the next week so it might take some time to reply.

This patch converts the cfi modules to the symbol_*
api.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

diff -ruN linux-2.6.16-git6/drivers/mtd/chips/cfi_cmdset_0001.c linux-2.6.16-git6.new/drivers/mtd/chips/cfi_cmdset_0001.c
--- linux-2.6.16-git6/drivers/mtd/chips/cfi_cmdset_0001.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git6.new/drivers/mtd/chips/cfi_cmdset_0001.c	2006-03-24 10:40:48.000000000 +0100
@@ -332,11 +332,11 @@
 }
 
 /* This routine is made available to other mtd code via
- * inter_module_register.  It must only be accessed through
- * inter_module_get which will bump the use count of this module.  The
+ * EXPORT_SYMBOL.  It must only be accessed through
+ * symbol_get which will bump the use count of this module.  The
  * addresses passed back in cfi are valid as long as the use count of
- * this module is non-zero, i.e. between inter_module_get and
- * inter_module_put.  Keith Owens <kaos@ocs.com.au> 29 Oct 2000.
+ * this module is non-zero, i.e. between symbol_get and
+ * symbol_put.  Keith Owens <kaos@ocs.com.au> 29 Oct 2000.
  */
 struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary)
 {
@@ -2445,23 +2445,15 @@
 	kfree(mtd->eraseregions);
 }
 
-static char im_name_0001[] = "cfi_cmdset_0001";
-static char im_name_0003[] = "cfi_cmdset_0003";
-static char im_name_0200[] = "cfi_cmdset_0200";
+EXPORT_SYMBOL(cfi_cmdset_0001);
 
 static int __init cfi_intelext_init(void)
 {
-	inter_module_register(im_name_0001, THIS_MODULE, &cfi_cmdset_0001);
-	inter_module_register(im_name_0003, THIS_MODULE, &cfi_cmdset_0001);
-	inter_module_register(im_name_0200, THIS_MODULE, &cfi_cmdset_0001);
 	return 0;
 }
 
 static void __exit cfi_intelext_exit(void)
 {
-	inter_module_unregister(im_name_0001);
-	inter_module_unregister(im_name_0003);
-	inter_module_unregister(im_name_0200);
 }
 
 module_init(cfi_intelext_init);
diff -ruN linux-2.6.16-git6/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.6.16-git6.new/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.6.16-git6/drivers/mtd/chips/cfi_cmdset_0002.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git6.new/drivers/mtd/chips/cfi_cmdset_0002.c	2006-03-24 10:41:07.000000000 +0100
@@ -1758,19 +1758,16 @@
 	kfree(mtd->eraseregions);
 }
 
-static char im_name[]="cfi_cmdset_0002";
-
+EXPORT_SYMBOL(cfi_cmdset_0002);
 
 static int __init cfi_amdstd_init(void)
 {
-	inter_module_register(im_name, THIS_MODULE, &cfi_cmdset_0002);
 	return 0;
 }
 
 
 static void __exit cfi_amdstd_exit(void)
 {
-	inter_module_unregister(im_name);
 }
 
 
diff -ruN linux-2.6.16-git6/drivers/mtd/chips/cfi_cmdset_0020.c linux-2.6.16-git6.new/drivers/mtd/chips/cfi_cmdset_0020.c
--- linux-2.6.16-git6/drivers/mtd/chips/cfi_cmdset_0020.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git6.new/drivers/mtd/chips/cfi_cmdset_0020.c	2006-03-24 10:41:16.000000000 +0100
@@ -108,11 +108,11 @@
 #endif
 
 /* This routine is made available to other mtd code via
- * inter_module_register.  It must only be accessed through
- * inter_module_get which will bump the use count of this module.  The
+ * EXPORT_SYMBOL.  It must only be accessed through
+ * symbol_get which will bump the use count of this module.  The
  * addresses passed back in cfi are valid as long as the use count of
- * this module is non-zero, i.e. between inter_module_get and
- * inter_module_put.  Keith Owens <kaos@ocs.com.au> 29 Oct 2000.
+ * this module is non-zero, i.e. between symbol_get and
+ * symbol_put.  Keith Owens <kaos@ocs.com.au> 29 Oct 2000.
  */
 struct mtd_info *cfi_cmdset_0020(struct map_info *map, int primary)
 {
@@ -1410,17 +1410,15 @@
 	kfree(cfi);
 }
 
-static char im_name[]="cfi_cmdset_0020";
+EXPORT_SYMBOL(cfi_cmdset_0020);
 
 static int __init cfi_staa_init(void)
 {
-	inter_module_register(im_name, THIS_MODULE, &cfi_cmdset_0020);
 	return 0;
 }
 
 static void __exit cfi_staa_exit(void)
 {
-	inter_module_unregister(im_name);
 }
 
 module_init(cfi_staa_init);
diff -ruN linux-2.6.16-git6/drivers/mtd/chips/gen_probe.c linux-2.6.16-git6.new/drivers/mtd/chips/gen_probe.c
--- linux-2.6.16-git6/drivers/mtd/chips/gen_probe.c	2006-03-20 06:53:29.000000000 +0100
+++ linux-2.6.16-git6.new/drivers/mtd/chips/gen_probe.c	2006-03-24 10:40:07.000000000 +0100
@@ -200,14 +200,17 @@
 
 	sprintf(probename, "cfi_cmdset_%4.4X", type);
 
-	probe_function = inter_module_get_request(probename, probename);
+	if (!request_module(probename))
+			return NULL;
+			
+	probe_function = symbol_get(probename);
 
 	if (probe_function) {
 		struct mtd_info *mtd;
 
 		mtd = (*probe_function)(map, primary);
 		/* If it was happy, it'll have increased its own use count */
-		inter_module_put(probename);
+		symbol_put(probename);
 		return mtd;
 	}
 #endif



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-24  9:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-24  9:58 [KJ] [Patch] convert mtd/chips/cfi* to symbol_put functions Eric Sesterhenn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).