diff options
Diffstat (limited to 'drivers/mtd/devices/docprobe.c')
-rw-r--r-- | drivers/mtd/devices/docprobe.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/mtd/devices/docprobe.c b/drivers/mtd/devices/docprobe.c index 13178b9dd00a..593bb033a3fa 100644 --- a/drivers/mtd/devices/docprobe.c +++ b/drivers/mtd/devices/docprobe.c | |||
@@ -231,6 +231,10 @@ static inline int __init doccheck(void __iomem *potential, unsigned long physadr | |||
231 | 231 | ||
232 | static int docfound; | 232 | static int docfound; |
233 | 233 | ||
234 | extern void DoC2k_init(struct mtd_info *); | ||
235 | extern void DoCMil_init(struct mtd_info *); | ||
236 | extern void DoCMilPlus_init(struct mtd_info *); | ||
237 | |||
234 | static void __init DoC_Probe(unsigned long physadr) | 238 | static void __init DoC_Probe(unsigned long physadr) |
235 | { | 239 | { |
236 | void __iomem *docptr; | 240 | void __iomem *docptr; |
@@ -239,8 +243,6 @@ static void __init DoC_Probe(unsigned long physadr) | |||
239 | int ChipID; | 243 | int ChipID; |
240 | char namebuf[15]; | 244 | char namebuf[15]; |
241 | char *name = namebuf; | 245 | char *name = namebuf; |
242 | char *im_funcname = NULL; | ||
243 | char *im_modname = NULL; | ||
244 | void (*initroutine)(struct mtd_info *) = NULL; | 246 | void (*initroutine)(struct mtd_info *) = NULL; |
245 | 247 | ||
246 | docptr = ioremap(physadr, DOC_IOREMAP_LEN); | 248 | docptr = ioremap(physadr, DOC_IOREMAP_LEN); |
@@ -278,41 +280,33 @@ static void __init DoC_Probe(unsigned long physadr) | |||
278 | switch(ChipID) { | 280 | switch(ChipID) { |
279 | case DOC_ChipID_Doc2kTSOP: | 281 | case DOC_ChipID_Doc2kTSOP: |
280 | name="2000 TSOP"; | 282 | name="2000 TSOP"; |
281 | im_funcname = "DoC2k_init"; | 283 | initroutine = symbol_request(DoC2k_init); |
282 | im_modname = "doc2000"; | ||
283 | break; | 284 | break; |
284 | 285 | ||
285 | case DOC_ChipID_Doc2k: | 286 | case DOC_ChipID_Doc2k: |
286 | name="2000"; | 287 | name="2000"; |
287 | im_funcname = "DoC2k_init"; | 288 | initroutine = symbol_request(DoC2k_init); |
288 | im_modname = "doc2000"; | ||
289 | break; | 289 | break; |
290 | 290 | ||
291 | case DOC_ChipID_DocMil: | 291 | case DOC_ChipID_DocMil: |
292 | name="Millennium"; | 292 | name="Millennium"; |
293 | #ifdef DOC_SINGLE_DRIVER | 293 | #ifdef DOC_SINGLE_DRIVER |
294 | im_funcname = "DoC2k_init"; | 294 | initroutine = symbol_request(DoC2k_init); |
295 | im_modname = "doc2000"; | ||
296 | #else | 295 | #else |
297 | im_funcname = "DoCMil_init"; | 296 | initroutine = symbol_request(DoCMil_init); |
298 | im_modname = "doc2001"; | ||
299 | #endif /* DOC_SINGLE_DRIVER */ | 297 | #endif /* DOC_SINGLE_DRIVER */ |
300 | break; | 298 | break; |
301 | 299 | ||
302 | case DOC_ChipID_DocMilPlus16: | 300 | case DOC_ChipID_DocMilPlus16: |
303 | case DOC_ChipID_DocMilPlus32: | 301 | case DOC_ChipID_DocMilPlus32: |
304 | name="MillenniumPlus"; | 302 | name="MillenniumPlus"; |
305 | im_funcname = "DoCMilPlus_init"; | 303 | initroutine = symbol_request(DoCMilPlus_init); |
306 | im_modname = "doc2001plus"; | ||
307 | break; | 304 | break; |
308 | } | 305 | } |
309 | 306 | ||
310 | if (im_funcname) | ||
311 | initroutine = inter_module_get_request(im_funcname, im_modname); | ||
312 | |||
313 | if (initroutine) { | 307 | if (initroutine) { |
314 | (*initroutine)(mtd); | 308 | (*initroutine)(mtd); |
315 | inter_module_put(im_funcname); | 309 | symbol_put_addr(initroutine); |
316 | return; | 310 | return; |
317 | } | 311 | } |
318 | printk(KERN_NOTICE "Cannot find driver for DiskOnChip %s at 0x%lX\n", name, physadr); | 312 | printk(KERN_NOTICE "Cannot find driver for DiskOnChip %s at 0x%lX\n", name, physadr); |