Skip to content

Commit

Permalink
Remove inter_module_xxx() from DiskOnChip drivers.
Browse files Browse the repository at this point in the history
Finally putting it back how it was before Keith got at it -- yay :)

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
David Woodhouse committed May 8, 2006
1 parent 73566ed commit 5e53542
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 64 deletions.
1 change: 0 additions & 1 deletion drivers/mtd/devices/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ config MTD_DOC2001PLUS
config MTD_DOCPROBE
tristate
select MTD_DOCECC
select OBSOLETE_INTERMODULE

config MTD_DOCECC
tristate
Expand Down
7 changes: 0 additions & 7 deletions drivers/mtd/devices/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
#
# $Id: Makefile.common,v 1.7 2004/12/22 17:51:15 joern Exp $

# *** BIG UGLY NOTE ***
#
# The removal of get_module_symbol() and replacement with
# inter_module_register() et al has introduced a link order dependency
# here where previously there was none. We now have to ensure that
# doc200[01].o are linked before docprobe.o

obj-$(CONFIG_MTD_DOC2000) += doc2000.o
obj-$(CONFIG_MTD_DOC2001) += doc2001.o
obj-$(CONFIG_MTD_DOC2001PLUS) += doc2001plus.o
Expand Down
22 changes: 4 additions & 18 deletions drivers/mtd/devices/doc2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,16 +517,9 @@ static int DoC2k_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2)
return retval;
}

static const char im_name[] = "DoC2k_init";

/* 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
* addresses passed back in mtd 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.
*/
static void DoC2k_init(struct mtd_info *mtd)
/* This routine is found from the docprobe code by symbol_get(),
* which will bump the use count of this module. */
void DoC2k_init(struct mtd_info *mtd)
{
struct DiskOnChip *this = mtd->priv;
struct DiskOnChip *old = NULL;
Expand Down Expand Up @@ -623,6 +616,7 @@ static void DoC2k_init(struct mtd_info *mtd)
return;
}
}
EXPORT_SYMBOL_GPL(DoC2k_init);

static int doc_read(struct mtd_info *mtd, loff_t from, size_t len,
size_t * retlen, u_char * buf)
Expand Down Expand Up @@ -1277,12 +1271,6 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
*
****************************************************************************/

static int __init init_doc2000(void)
{
inter_module_register(im_name, THIS_MODULE, &DoC2k_init);
return 0;
}

static void __exit cleanup_doc2000(void)
{
struct mtd_info *mtd;
Expand All @@ -1298,11 +1286,9 @@ static void __exit cleanup_doc2000(void)
kfree(this->chips);
kfree(mtd);
}
inter_module_unregister(im_name);
}

module_exit(cleanup_doc2000);
module_init(init_doc2000);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al.");
Expand Down
22 changes: 4 additions & 18 deletions drivers/mtd/devices/doc2001.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,9 @@ static int DoCMil_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2)
return retval;
}

static const char im_name[] = "DoCMil_init";

/* 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
* addresses passed back in mtd 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.
*/
static void DoCMil_init(struct mtd_info *mtd)
/* This routine is found from the docprobe code by symbol_get(),
* which will bump the use count of this module. */
void DoCMil_init(struct mtd_info *mtd)
{
struct DiskOnChip *this = mtd->priv;
struct DiskOnChip *old = NULL;
Expand Down Expand Up @@ -401,6 +394,7 @@ static void DoCMil_init(struct mtd_info *mtd)
return;
}
}
EXPORT_SYMBOL_GPL(DocMil_init);

static int doc_read (struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf)
Expand Down Expand Up @@ -856,12 +850,6 @@ int doc_erase (struct mtd_info *mtd, struct erase_info *instr)
*
****************************************************************************/

static int __init init_doc2001(void)
{
inter_module_register(im_name, THIS_MODULE, &DoCMil_init);
return 0;
}

static void __exit cleanup_doc2001(void)
{
struct mtd_info *mtd;
Expand All @@ -877,11 +865,9 @@ static void __exit cleanup_doc2001(void)
kfree(this->chips);
kfree(mtd);
}
inter_module_unregister(im_name);
}

module_exit(cleanup_doc2001);
module_init(init_doc2001);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org> et al.");
Expand Down
22 changes: 4 additions & 18 deletions drivers/mtd/devices/doc2001plus.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,16 +447,9 @@ static int DoCMilPlus_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2)
return retval;
}

static const char im_name[] = "DoCMilPlus_init";

/* 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
* addresses passed back in mtd 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.
*/
static void DoCMilPlus_init(struct mtd_info *mtd)
/* This routine is found from the docprobe code by symbol_get(),
* which will bump the use count of this module. */
void DoCMilPlus_init(struct mtd_info *mtd)
{
struct DiskOnChip *this = mtd->priv;
struct DiskOnChip *old = NULL;
Expand Down Expand Up @@ -524,6 +517,7 @@ static void DoCMilPlus_init(struct mtd_info *mtd)
return;
}
}
EXPORT_SYMBOL_GPL(DocMilPlus_init);

#if 0
static int doc_dumpblk(struct mtd_info *mtd, loff_t from)
Expand Down Expand Up @@ -1122,12 +1116,6 @@ int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
*
****************************************************************************/

static int __init init_doc2001plus(void)
{
inter_module_register(im_name, THIS_MODULE, &DoCMilPlus_init);
return 0;
}

static void __exit cleanup_doc2001plus(void)
{
struct mtd_info *mtd;
Expand All @@ -1143,11 +1131,9 @@ static void __exit cleanup_doc2001plus(void)
kfree(this->chips);
kfree(mtd);
}
inter_module_unregister(im_name);
}

module_exit(cleanup_doc2001plus);
module_init(init_doc2001plus);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Greg Ungerer <gerg@snapgear.com> et al.");
Expand Down
8 changes: 6 additions & 2 deletions drivers/mtd/devices/docprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,15 @@ static void __init DoC_Probe(unsigned long physadr)
}

if (im_funcname)
initroutine = inter_module_get_request(im_funcname, im_modname);
initroutine = symbol_get(im_funcname);
if (!initroutine) {
request_module(in_modname);
initroutine = symbol_get(im_funcname);
}

if (initroutine) {
(*initroutine)(mtd);
inter_module_put(im_funcname);
symbol_put_addr(initroutine);
return;
}
printk(KERN_NOTICE "Cannot find driver for DiskOnChip %s at 0x%lX\n", name, physadr);
Expand Down

0 comments on commit 5e53542

Please sign in to comment.