diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-08 12:10:11 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-08 12:10:11 -0400 |
commit | 396674e58fb9d01b7768ccb8db181aea8ebead0e (patch) | |
tree | 827b925d0fa37c19fd78a4e2a981c93a575066d5 /drivers/mtd/devices/docprobe.c | |
parent | 5e535429a9117b8b6219da0e0cb087f52c0c9597 (diff) |
Fix non-modular case for DiskOnChip probe
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/devices/docprobe.c')
-rw-r--r-- | 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 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 | ||
232 | static int docfound; | 232 | static int docfound; |
233 | 233 | ||
234 | #ifdef CONFIG_DOC2000 | ||
235 | extern 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 | ||
242 | extern 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 | ||
249 | extern void DoCMilPlus_init(struct mtd_info *); | ||
250 | #define docmplus_initfunc (&DoCMilPlus_init) | ||
251 | #else | ||
252 | #define docmplus_initfunc NULL | ||
253 | #endif | ||
254 | |||
234 | static void __init DoC_Probe(unsigned long physadr) | 255 | static 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); |