aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/devices')
-rw-r--r--drivers/mtd/devices/docprobe.c35
1 files changed, 31 insertions, 4 deletions
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c
index b83afe01574c..32f1d332f5b5 100644
--- a/drivers/mtd/devices/docprobe.c
+++ b/drivers/mtd/devices/docprobe.c
@@ -231,6 +231,27 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr
231 231
232static int docfound; 232static int docfound;
233 233
234#ifdef CONFIG_DOC2000
235extern void DoC2k_init(struct mtd_info *);
236#define doc2k_initfunc (&DoC2k_init)
237#else
238#define doc2k_initfunc NULL
239#endif
240
241#ifdef CONFIG_DOC2001
242extern void DoCMil_init(struct mtd_info *);
243#define docmil_initfunc (&DoCMil_init)
244#else
245#define docmil_initfunc NULL
246#endif
247
248#ifdef CONFIG_DOC2001PLUS
249extern void DoCMilPlus_init(struct mtd_info *);
250#define docmplus_initfunc (&DoCMilPlus_init)
251#else
252#define docmplus_initfunc NULL
253#endif
254
234static void __init DoC_Probe(unsigned long physadr) 255static void __init DoC_Probe(unsigned long physadr)
235{ 256{
236 void __iomem *docptr; 257 void __iomem *docptr;
@@ -280,12 +301,14 @@ static void __init DoC_Probe(unsigned long physadr)
280 name="2000 TSOP"; 301 name="2000 TSOP";
281 im_funcname = "DoC2k_init"; 302 im_funcname = "DoC2k_init";
282 im_modname = "doc2000"; 303 im_modname = "doc2000";
304 initroutine = doc2k_initfunc;
283 break; 305 break;
284 306
285 case DOC_ChipID_Doc2k: 307 case DOC_ChipID_Doc2k:
286 name="2000"; 308 name="2000";
287 im_funcname = "DoC2k_init"; 309 im_funcname = "DoC2k_init";
288 im_modname = "doc2000"; 310 im_modname = "doc2000";
311 initroutine = doc2k_initfunc;
289 break; 312 break;
290 313
291 case DOC_ChipID_DocMil: 314 case DOC_ChipID_DocMil:
@@ -293,9 +316,11 @@ static void __init DoC_Probe(unsigned long physadr)
293#ifdef DOC_SINGLE_DRIVER 316#ifdef DOC_SINGLE_DRIVER
294 im_funcname = "DoC2k_init"; 317 im_funcname = "DoC2k_init";
295 im_modname = "doc2000"; 318 im_modname = "doc2000";
319 initroutine = doc2k_initfunc;
296#else 320#else
297 im_funcname = "DoCMil_init"; 321 im_funcname = "DoCMil_init";
298 im_modname = "doc2001"; 322 im_modname = "doc2001";
323 initroutine = docmil_initfunc;
299#endif /* DOC_SINGLE_DRIVER */ 324#endif /* DOC_SINGLE_DRIVER */
300 break; 325 break;
301 326
@@ -304,16 +329,18 @@ static void __init DoC_Probe(unsigned long physadr)
304 name="MillenniumPlus"; 329 name="MillenniumPlus";
305 im_funcname = "DoCMilPlus_init"; 330 im_funcname = "DoCMilPlus_init";
306 im_modname = "doc2001plus"; 331 im_modname = "doc2001plus";
332 initroutine = docmplus_initfunc;
307 break; 333 break;
308 } 334 }
309 335
310 if (im_funcname) 336#ifdef CONFIG_MODULES
337 if (im_funcname && !initroutine)
311 initroutine = symbol_get(im_funcname); 338 initroutine = symbol_get(im_funcname);
312 if (!initroutine) { 339 if (im_funcname && !initroutine) {
313 request_module(in_modname); 340 request_module(im_modname);
314 initroutine = symbol_get(im_funcname); 341 initroutine = symbol_get(im_funcname);
315 } 342 }
316 343#endif
317 if (initroutine) { 344 if (initroutine) {
318 (*initroutine)(mtd); 345 (*initroutine)(mtd);
319 symbol_put_addr(initroutine); 346 symbol_put_addr(initroutine);