Fix non-modular case for DiskOnChip probe
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon May 8 12:59:02 EDT 2006
commit 396674e58fb9d01b7768ccb8db181aea8ebead0e
tree 827b925d0fa37c19fd78a4e2a981c93a575066d5
parent 5e535429a9117b8b6219da0e0cb087f52c0c9597
author David Woodhouse <dwmw2 at infradead.org> Mon, 08 May 2006 17:10:11 +0100
committer David Woodhouse <dwmw2 at infradead.org> Mon, 08 May 2006 17:10:11 +0100
Fix non-modular case for DiskOnChip probe
Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
drivers/mtd/devices/docprobe.c | 35 +++++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c
index b83afe0..32f1d33 100644
--- a/drivers/mtd/devices/docprobe.c
+++ b/drivers/mtd/devices/docprobe.c
@@ -231,6 +231,27 @@ #endif
static int docfound;
+#ifdef CONFIG_DOC2000
+extern void DoC2k_init(struct mtd_info *);
+#define doc2k_initfunc (&DoC2k_init)
+#else
+#define doc2k_initfunc NULL
+#endif
+
+#ifdef CONFIG_DOC2001
+extern void DoCMil_init(struct mtd_info *);
+#define docmil_initfunc (&DoCMil_init)
+#else
+#define docmil_initfunc NULL
+#endif
+
+#ifdef CONFIG_DOC2001PLUS
+extern void DoCMilPlus_init(struct mtd_info *);
+#define docmplus_initfunc (&DoCMilPlus_init)
+#else
+#define docmplus_initfunc NULL
+#endif
+
static void __init DoC_Probe(unsigned long physadr)
{
void __iomem *docptr;
@@ -280,12 +301,14 @@ static void __init DoC_Probe(unsigned lo
name="2000 TSOP";
im_funcname = "DoC2k_init";
im_modname = "doc2000";
+ initroutine = doc2k_initfunc;
break;
case DOC_ChipID_Doc2k:
name="2000";
im_funcname = "DoC2k_init";
im_modname = "doc2000";
+ initroutine = doc2k_initfunc;
break;
case DOC_ChipID_DocMil:
@@ -293,9 +316,11 @@ static void __init DoC_Probe(unsigned lo
#ifdef DOC_SINGLE_DRIVER
im_funcname = "DoC2k_init";
im_modname = "doc2000";
+ initroutine = doc2k_initfunc;
#else
im_funcname = "DoCMil_init";
im_modname = "doc2001";
+ initroutine = docmil_initfunc;
#endif /* DOC_SINGLE_DRIVER */
break;
@@ -304,16 +329,18 @@ #endif /* DOC_SINGLE_DRIVER */
name="MillenniumPlus";
im_funcname = "DoCMilPlus_init";
im_modname = "doc2001plus";
+ initroutine = docmplus_initfunc;
break;
}
- if (im_funcname)
+#ifdef CONFIG_MODULES
+ if (im_funcname && !initroutine)
initroutine = symbol_get(im_funcname);
- if (!initroutine) {
- request_module(in_modname);
+ if (im_funcname && !initroutine) {
+ request_module(im_modname);
initroutine = symbol_get(im_funcname);
}
-
+#endif
if (initroutine) {
(*initroutine)(mtd);
symbol_put_addr(initroutine);
More information about the linux-mtd-cvs
mailing list