mtd: struct device - replace bus_id with dev_name(), dev_set_name()
[linux-2.6.git] / drivers / mtd / devices / docprobe.c
index b83afe0..6e62922 100644 (file)
@@ -4,9 +4,6 @@
 /* (C) 1999 Machine Vision Holdings, Inc.                      */
 /* (C) 1999-2003 David Woodhouse <dwmw2@infradead.org>         */
 
-/* $Id: docprobe.c,v 1.46 2005/11/07 11:14:25 gleixner Exp $   */
-
-
 
 /* DOC_PASSIVE_PROBE:
    In order to ensure that the BIOS checksum is correct at boot time, and
@@ -40,7 +37,6 @@
 */
 #define DOC_SINGLE_DRIVER
 
-#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <asm/errno.h>
@@ -80,14 +76,7 @@ static unsigned long __initdata doc_locations[] = {
        0xe0000, 0xe2000, 0xe4000, 0xe6000,
        0xe8000, 0xea000, 0xec000, 0xee000,
 #endif /*  CONFIG_MTD_DOCPROBE_HIGH */
-#elif defined(__PPC__)
-       0xe4000000,
-#elif defined(CONFIG_MOMENCO_OCELOT)
-       0x2f000000,
-        0xff000000,
-#elif defined(CONFIG_MOMENCO_OCELOT_G) || defined (CONFIG_MOMENCO_OCELOT_C)
-        0xff000000,
-##else
+#else
 #warning Unknown architecture for DiskOnChip. No default probe locations defined
 #endif
        0xffffffff };
@@ -231,6 +220,10 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr
 
 static int docfound;
 
+extern void DoC2k_init(struct mtd_info *);
+extern void DoCMil_init(struct mtd_info *);
+extern void DoCMilPlus_init(struct mtd_info *);
+
 static void __init DoC_Probe(unsigned long physadr)
 {
        void __iomem *docptr;
@@ -239,8 +232,6 @@ static void __init DoC_Probe(unsigned long physadr)
        int ChipID;
        char namebuf[15];
        char *name = namebuf;
-       char *im_funcname = NULL;
-       char *im_modname = NULL;
        void (*initroutine)(struct mtd_info *) = NULL;
 
        docptr = ioremap(physadr, DOC_IOREMAP_LEN);
@@ -278,42 +269,30 @@ static void __init DoC_Probe(unsigned long physadr)
                switch(ChipID) {
                case DOC_ChipID_Doc2kTSOP:
                        name="2000 TSOP";
-                       im_funcname = "DoC2k_init";
-                       im_modname = "doc2000";
+                       initroutine = symbol_request(DoC2k_init);
                        break;
 
                case DOC_ChipID_Doc2k:
                        name="2000";
-                       im_funcname = "DoC2k_init";
-                       im_modname = "doc2000";
+                       initroutine = symbol_request(DoC2k_init);
                        break;
 
                case DOC_ChipID_DocMil:
                        name="Millennium";
 #ifdef DOC_SINGLE_DRIVER
-                       im_funcname = "DoC2k_init";
-                       im_modname = "doc2000";
+                       initroutine = symbol_request(DoC2k_init);
 #else
-                       im_funcname = "DoCMil_init";
-                       im_modname = "doc2001";
+                       initroutine = symbol_request(DoCMil_init);
 #endif /* DOC_SINGLE_DRIVER */
                        break;
 
                case DOC_ChipID_DocMilPlus16:
                case DOC_ChipID_DocMilPlus32:
                        name="MillenniumPlus";
-                       im_funcname = "DoCMilPlus_init";
-                       im_modname = "doc2001plus";
+                       initroutine = symbol_request(DoCMilPlus_init);
                        break;
                }
 
-               if (im_funcname)
-                       initroutine = symbol_get(im_funcname);
-               if (!initroutine) {
-                       request_module(in_modname);
-                       initroutine = symbol_get(im_funcname);
-               }
-
                if (initroutine) {
                        (*initroutine)(mtd);
                        symbol_put_addr(initroutine);