aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips/gen_probe.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2006-05-08 17:35:05 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2006-05-08 17:35:05 -0400
commita15bdeef108d282e540e202fc3c3e4bdf9692074 (patch)
tree1bc767c9013713a4d62d1bc5dffef631583e6ee7 /drivers/mtd/chips/gen_probe.c
parent396674e58fb9d01b7768ccb8db181aea8ebead0e (diff)
Remove use of inter_module_crap in NOR flash chip drivers.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'drivers/mtd/chips/gen_probe.c')
-rw-r--r--drivers/mtd/chips/gen_probe.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/mtd/chips/gen_probe.c b/drivers/mtd/chips/gen_probe.c
index 41bd59d20d85..9b252d2e4a70 100644
--- a/drivers/mtd/chips/gen_probe.c
+++ b/drivers/mtd/chips/gen_probe.c
@@ -194,25 +194,28 @@ static inline struct mtd_info *cfi_cmdset_unknown(struct map_info *map,
194{ 194{
195 struct cfi_private *cfi = map->fldrv_priv; 195 struct cfi_private *cfi = map->fldrv_priv;
196 __u16 type = primary?cfi->cfiq->P_ID:cfi->cfiq->A_ID; 196 __u16 type = primary?cfi->cfiq->P_ID:cfi->cfiq->A_ID;
197#if defined(CONFIG_MODULES) && defined(HAVE_INTER_MODULE) 197#ifdef CONFIG_MODULES
198 char probename[32]; 198 char probename[32];
199 cfi_cmdset_fn_t *probe_function; 199 cfi_cmdset_fn_t *probe_function;
200 200
201 sprintf(probename, "cfi_cmdset_%4.4X", type); 201 sprintf(probename, "cfi_cmdset_%4.4X", type);
202 202
203 probe_function = inter_module_get_request(probename, probename); 203 probe_function = (void *)symbol_get(probename);
204 if (!probe_function) {
205 request_module(probename);
206 probe_function = (void *)symbol_get(probename);
207 }
204 208
205 if (probe_function) { 209 if (probe_function) {
206 struct mtd_info *mtd; 210 struct mtd_info *mtd;
207 211
208 mtd = (*probe_function)(map, primary); 212 mtd = (*probe_function)(map, primary);
209 /* If it was happy, it'll have increased its own use count */ 213 /* If it was happy, it'll have increased its own use count */
210 inter_module_put(probename); 214 symbol_put_addr(probe_function);
211 return mtd; 215 return mtd;
212 } 216 }
213#endif 217#endif
214 printk(KERN_NOTICE "Support for command set %04X not present\n", 218 printk(KERN_NOTICE "Support for command set %04X not present\n", type);
215 type);
216 219
217 return NULL; 220 return NULL;
218} 221}
@@ -226,12 +229,8 @@ static struct mtd_info *check_cmd_set(struct map_info *map, int primary)
226 return NULL; 229 return NULL;
227 230
228 switch(type){ 231 switch(type){
229 /* Urgh. Ifdefs. The version with weak symbols was 232 /* We need these for the !CONFIG_MODULES case,
230 * _much_ nicer. Shame it didn't seem to work on 233 because symbol_get() doesn't work there */
231 * anything but x86, really.
232 * But we can't rely in inter_module_get() because
233 * that'd mean we depend on link order.
234 */
235#ifdef CONFIG_MTD_CFI_INTELEXT 234#ifdef CONFIG_MTD_CFI_INTELEXT
236 case 0x0001: 235 case 0x0001:
237 case 0x0003: 236 case 0x0003:
@@ -246,9 +245,9 @@ static struct mtd_info *check_cmd_set(struct map_info *map, int primary)
246 case 0x0020: 245 case 0x0020:
247 return cfi_cmdset_0020(map, primary); 246 return cfi_cmdset_0020(map, primary);
248#endif 247#endif
248 default:
249 return cfi_cmdset_unknown(map, primary);
249 } 250 }
250
251 return cfi_cmdset_unknown(map, primary);
252} 251}
253 252
254MODULE_LICENSE("GPL"); 253MODULE_LICENSE("GPL");