diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-08 09:05:05 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-08 09:05:05 -0400 |
commit | 5e535429a9117b8b6219da0e0cb087f52c0c9597 (patch) | |
tree | b20a402b5696e2b5aabdc7a4720eaf33e306bd71 /drivers/mtd | |
parent | 73566edf9b91dd085ddb12033d0ea7288979dd10 (diff) |
Remove inter_module_xxx() from DiskOnChip drivers.
Finally putting it back how it was before Keith got at it -- yay :)
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/devices/Kconfig | 1 | ||||
-rw-r--r-- | drivers/mtd/devices/Makefile | 7 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2000.c | 22 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2001.c | 22 | ||||
-rw-r--r-- | drivers/mtd/devices/doc2001plus.c | 22 | ||||
-rw-r--r-- | drivers/mtd/devices/docprobe.c | 8 |
6 files changed, 18 insertions, 64 deletions
diff --git a/drivers/mtd/devices/Kconfig b/drivers/mtd/devices/Kconfig index 7fac438b5c32..6e9f880e2f98 100644 --- a/drivers/mtd/devices/Kconfig +++ b/drivers/mtd/devices/Kconfig | |||
@@ -209,7 +209,6 @@ config MTD_DOC2001PLUS | |||
209 | config MTD_DOCPROBE | 209 | config MTD_DOCPROBE |
210 | tristate | 210 | tristate |
211 | select MTD_DOCECC | 211 | select MTD_DOCECC |
212 | select OBSOLETE_INTERMODULE | ||
213 | 212 | ||
214 | config MTD_DOCECC | 213 | config MTD_DOCECC |
215 | tristate | 214 | tristate |
diff --git a/drivers/mtd/devices/Makefile b/drivers/mtd/devices/Makefile index b6573670316f..0f788d5c4bf8 100644 --- a/drivers/mtd/devices/Makefile +++ b/drivers/mtd/devices/Makefile | |||
@@ -3,13 +3,6 @@ | |||
3 | # | 3 | # |
4 | # $Id: Makefile.common,v 1.7 2004/12/22 17:51:15 joern Exp $ | 4 | # $Id: Makefile.common,v 1.7 2004/12/22 17:51:15 joern Exp $ |
5 | 5 | ||
6 | # *** BIG UGLY NOTE *** | ||
7 | # | ||
8 | # The removal of get_module_symbol() and replacement with | ||
9 | # inter_module_register() et al has introduced a link order dependency | ||
10 | # here where previously there was none. We now have to ensure that | ||
11 | # doc200[01].o are linked before docprobe.o | ||
12 | |||
13 | obj-$(CONFIG_MTD_DOC2000) += doc2000.o | 6 | obj-$(CONFIG_MTD_DOC2000) += doc2000.o |
14 | obj-$(CONFIG_MTD_DOC2001) += doc2001.o | 7 | obj-$(CONFIG_MTD_DOC2001) += doc2001.o |
15 | obj-$(CONFIG_MTD_DOC2001PLUS) += doc2001plus.o | 8 | obj-$(CONFIG_MTD_DOC2001PLUS) += doc2001plus.o |
diff --git a/drivers/mtd/devices/doc2000.c b/drivers/mtd/devices/doc2000.c index 23e7a5c7d2c1..40cc20f6d164 100644 --- a/drivers/mtd/devices/doc2000.c +++ b/drivers/mtd/devices/doc2000.c | |||
@@ -517,16 +517,9 @@ static int DoC2k_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2) | |||
517 | return retval; | 517 | return retval; |
518 | } | 518 | } |
519 | 519 | ||
520 | static const char im_name[] = "DoC2k_init"; | 520 | /* This routine is found from the docprobe code by symbol_get(), |
521 | 521 | * which will bump the use count of this module. */ | |
522 | /* This routine is made available to other mtd code via | 522 | void DoC2k_init(struct mtd_info *mtd) |
523 | * inter_module_register. It must only be accessed through | ||
524 | * inter_module_get which will bump the use count of this module. The | ||
525 | * addresses passed back in mtd are valid as long as the use count of | ||
526 | * this module is non-zero, i.e. between inter_module_get and | ||
527 | * inter_module_put. Keith Owens <kaos@ocs.com.au> 29 Oct 2000. | ||
528 | */ | ||
529 | static void DoC2k_init(struct mtd_info *mtd) | ||
530 | { | 523 | { |
531 | struct DiskOnChip *this = mtd->priv; | 524 | struct DiskOnChip *this = mtd->priv; |
532 | struct DiskOnChip *old = NULL; | 525 | struct DiskOnChip *old = NULL; |
@@ -623,6 +616,7 @@ static void DoC2k_init(struct mtd_info *mtd) | |||
623 | return; | 616 | return; |
624 | } | 617 | } |
625 | } | 618 | } |
619 | EXPORT_SYMBOL_GPL(DoC2k_init); | ||
626 | 620 | ||
627 | static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, | 621 | static int doc_read(struct mtd_info *mtd, loff_t from, size_t len, |
628 | size_t * retlen, u_char * buf) | 622 | size_t * retlen, u_char * buf) |
@@ -1277,12 +1271,6 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
1277 | * | 1271 | * |
1278 | ****************************************************************************/ | 1272 | ****************************************************************************/ |
1279 | 1273 | ||
1280 | static int __init init_doc2000(void) | ||
1281 | { | ||
1282 | inter_module_register(im_name, THIS_MODULE, &DoC2k_init); | ||
1283 | return 0; | ||
1284 | } | ||
1285 | |||
1286 | static void __exit cleanup_doc2000(void) | 1274 | static void __exit cleanup_doc2000(void) |
1287 | { | 1275 | { |
1288 | struct mtd_info *mtd; | 1276 | struct mtd_info *mtd; |
@@ -1298,11 +1286,9 @@ static void __exit cleanup_doc2000(void) | |||
1298 | kfree(this->chips); | 1286 | kfree(this->chips); |
1299 | kfree(mtd); | 1287 | kfree(mtd); |
1300 | } | 1288 | } |
1301 | inter_module_unregister(im_name); | ||
1302 | } | 1289 | } |
1303 | 1290 | ||
1304 | module_exit(cleanup_doc2000); | 1291 | module_exit(cleanup_doc2000); |
1305 | module_init(init_doc2000); | ||
1306 | 1292 | ||
1307 | MODULE_LICENSE("GPL"); | 1293 | MODULE_LICENSE("GPL"); |
1308 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al."); | 1294 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al."); |
diff --git a/drivers/mtd/devices/doc2001.c b/drivers/mtd/devices/doc2001.c index 681a9c73a2a3..18b536ca8546 100644 --- a/drivers/mtd/devices/doc2001.c +++ b/drivers/mtd/devices/doc2001.c | |||
@@ -324,16 +324,9 @@ static int DoCMil_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2) | |||
324 | return retval; | 324 | return retval; |
325 | } | 325 | } |
326 | 326 | ||
327 | static const char im_name[] = "DoCMil_init"; | 327 | /* This routine is found from the docprobe code by symbol_get(), |
328 | 328 | * which will bump the use count of this module. */ | |
329 | /* This routine is made available to other mtd code via | 329 | void DoCMil_init(struct mtd_info *mtd) |
330 | * inter_module_register. It must only be accessed through | ||
331 | * inter_module_get which will bump the use count of this module. The | ||
332 | * addresses passed back in mtd are valid as long as the use count of | ||
333 | * this module is non-zero, i.e. between inter_module_get and | ||
334 | * inter_module_put. Keith Owens <kaos@ocs.com.au> 29 Oct 2000. | ||
335 | */ | ||
336 | static void DoCMil_init(struct mtd_info *mtd) | ||
337 | { | 330 | { |
338 | struct DiskOnChip *this = mtd->priv; | 331 | struct DiskOnChip *this = mtd->priv; |
339 | struct DiskOnChip *old = NULL; | 332 | struct DiskOnChip *old = NULL; |
@@ -401,6 +394,7 @@ static void DoCMil_init(struct mtd_info *mtd) | |||
401 | return; | 394 | return; |
402 | } | 395 | } |
403 | } | 396 | } |
397 | EXPORT_SYMBOL_GPL(DocMil_init); | ||
404 | 398 | ||
405 | static int doc_read (struct mtd_info *mtd, loff_t from, size_t len, | 399 | static int doc_read (struct mtd_info *mtd, loff_t from, size_t len, |
406 | size_t *retlen, u_char *buf) | 400 | size_t *retlen, u_char *buf) |
@@ -856,12 +850,6 @@ int doc_erase (struct mtd_info *mtd, struct erase_info *instr) | |||
856 | * | 850 | * |
857 | ****************************************************************************/ | 851 | ****************************************************************************/ |
858 | 852 | ||
859 | static int __init init_doc2001(void) | ||
860 | { | ||
861 | inter_module_register(im_name, THIS_MODULE, &DoCMil_init); | ||
862 | return 0; | ||
863 | } | ||
864 | |||
865 | static void __exit cleanup_doc2001(void) | 853 | static void __exit cleanup_doc2001(void) |
866 | { | 854 | { |
867 | struct mtd_info *mtd; | 855 | struct mtd_info *mtd; |
@@ -877,11 +865,9 @@ static void __exit cleanup_doc2001(void) | |||
877 | kfree(this->chips); | 865 | kfree(this->chips); |
878 | kfree(mtd); | 866 | kfree(mtd); |
879 | } | 867 | } |
880 | inter_module_unregister(im_name); | ||
881 | } | 868 | } |
882 | 869 | ||
883 | module_exit(cleanup_doc2001); | 870 | module_exit(cleanup_doc2001); |
884 | module_init(init_doc2001); | ||
885 | 871 | ||
886 | MODULE_LICENSE("GPL"); | 872 | MODULE_LICENSE("GPL"); |
887 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al."); | 873 | MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al."); |
diff --git a/drivers/mtd/devices/doc2001plus.c b/drivers/mtd/devices/doc2001plus.c index 5f57f29efee4..c80a0efa3f35 100644 --- a/drivers/mtd/devices/doc2001plus.c +++ b/drivers/mtd/devices/doc2001plus.c | |||
@@ -447,16 +447,9 @@ static int DoCMilPlus_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2) | |||
447 | return retval; | 447 | return retval; |
448 | } | 448 | } |
449 | 449 | ||
450 | static const char im_name[] = "DoCMilPlus_init"; | 450 | /* This routine is found from the docprobe code by symbol_get(), |
451 | 451 | * which will bump the use count of this module. */ | |
452 | /* This routine is made available to other mtd code via | 452 | void DoCMilPlus_init(struct mtd_info *mtd) |
453 | * inter_module_register. It must only be accessed through | ||
454 | * inter_module_get which will bump the use count of this module. The | ||
455 | * addresses passed back in mtd are valid as long as the use count of | ||
456 | * this module is non-zero, i.e. between inter_module_get and | ||
457 | * inter_module_put. Keith Owens <kaos@ocs.com.au> 29 Oct 2000. | ||
458 | */ | ||
459 | static void DoCMilPlus_init(struct mtd_info *mtd) | ||
460 | { | 453 | { |
461 | struct DiskOnChip *this = mtd->priv; | 454 | struct DiskOnChip *this = mtd->priv; |
462 | struct DiskOnChip *old = NULL; | 455 | struct DiskOnChip *old = NULL; |
@@ -524,6 +517,7 @@ static void DoCMilPlus_init(struct mtd_info *mtd) | |||
524 | return; | 517 | return; |
525 | } | 518 | } |
526 | } | 519 | } |
520 | EXPORT_SYMBOL_GPL(DocMilPlus_init); | ||
527 | 521 | ||
528 | #if 0 | 522 | #if 0 |
529 | static int doc_dumpblk(struct mtd_info *mtd, loff_t from) | 523 | static int doc_dumpblk(struct mtd_info *mtd, loff_t from) |
@@ -1122,12 +1116,6 @@ int doc_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
1122 | * | 1116 | * |
1123 | ****************************************************************************/ | 1117 | ****************************************************************************/ |
1124 | 1118 | ||
1125 | static int __init init_doc2001plus(void) | ||
1126 | { | ||
1127 | inter_module_register(im_name, THIS_MODULE, &DoCMilPlus_init); | ||
1128 | return 0; | ||
1129 | } | ||
1130 | |||
1131 | static void __exit cleanup_doc2001plus(void) | 1119 | static void __exit cleanup_doc2001plus(void) |
1132 | { | 1120 | { |
1133 | struct mtd_info *mtd; | 1121 | struct mtd_info *mtd; |
@@ -1143,11 +1131,9 @@ static void __exit cleanup_doc2001plus(void) | |||
1143 | kfree(this->chips); | 1131 | kfree(this->chips); |
1144 | kfree(mtd); | 1132 | kfree(mtd); |
1145 | } | 1133 | } |
1146 | inter_module_unregister(im_name); | ||
1147 | } | 1134 | } |
1148 | 1135 | ||
1149 | module_exit(cleanup_doc2001plus); | 1136 | module_exit(cleanup_doc2001plus); |
1150 | module_init(init_doc2001plus); | ||
1151 | 1137 | ||
1152 | MODULE_LICENSE("GPL"); | 1138 | MODULE_LICENSE("GPL"); |
1153 | MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com> et al."); | 1139 | MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com> et al."); |
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c index 13178b9dd00a..b83afe01574c 100644 --- a/drivers/mtd/devices/docprobe.c +++ b/drivers/mtd/devices/docprobe.c | |||
@@ -308,11 +308,15 @@ static void __init DoC_Probe(unsigned long physadr) | |||
308 | } | 308 | } |
309 | 309 | ||
310 | if (im_funcname) | 310 | if (im_funcname) |
311 | initroutine = inter_module_get_request(im_funcname, im_modname); | 311 | initroutine = symbol_get(im_funcname); |
312 | if (!initroutine) { | ||
313 | request_module(in_modname); | ||
314 | initroutine = symbol_get(im_funcname); | ||
315 | } | ||
312 | 316 | ||
313 | if (initroutine) { | 317 | if (initroutine) { |
314 | (*initroutine)(mtd); | 318 | (*initroutine)(mtd); |
315 | inter_module_put(im_funcname); | 319 | symbol_put_addr(initroutine); |
316 | return; | 320 | return; |
317 | } | 321 | } |
318 | printk(KERN_NOTICE "Cannot find driver for DiskOnChip %s at 0x%lX\n", name, physadr); | 322 | printk(KERN_NOTICE "Cannot find driver for DiskOnChip %s at 0x%lX\n", name, physadr); |