diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-08 23:35:05 +0200 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-08 23:35:05 +0200 |
commit | a15bdeef108d282e540e202fc3c3e4bdf9692074 (patch) | |
tree | 1bc767c9013713a4d62d1bc5dffef631583e6ee7 /drivers/mtd/chips/gen_probe.c | |
parent | Fix non-modular case for DiskOnChip probe (diff) | |
download | linux-a15bdeef108d282e540e202fc3c3e4bdf9692074.tar.xz linux-a15bdeef108d282e540e202fc3c3e4bdf9692074.zip |
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.c | 25 |
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, { struct cfi_private *cfi = map->fldrv_priv; __u16 type = primary?cfi->cfiq->P_ID:cfi->cfiq->A_ID; -#if defined(CONFIG_MODULES) && defined(HAVE_INTER_MODULE) +#ifdef CONFIG_MODULES char probename[32]; cfi_cmdset_fn_t *probe_function; sprintf(probename, "cfi_cmdset_%4.4X", type); - probe_function = inter_module_get_request(probename, probename); + probe_function = (void *)symbol_get(probename); + if (!probe_function) { + request_module(probename); + probe_function = (void *)symbol_get(probename); + } if (probe_function) { struct mtd_info *mtd; mtd = (*probe_function)(map, primary); /* If it was happy, it'll have increased its own use count */ - inter_module_put(probename); + symbol_put_addr(probe_function); return mtd; } #endif - printk(KERN_NOTICE "Support for command set %04X not present\n", - type); + printk(KERN_NOTICE "Support for command set %04X not present\n", type); return NULL; } @@ -226,12 +229,8 @@ static struct mtd_info *check_cmd_set(struct map_info *map, int primary) return NULL; switch(type){ - /* Urgh. Ifdefs. The version with weak symbols was - * _much_ nicer. Shame it didn't seem to work on - * anything but x86, really. - * But we can't rely in inter_module_get() because - * that'd mean we depend on link order. - */ + /* We need these for the !CONFIG_MODULES case, + because symbol_get() doesn't work there */ #ifdef CONFIG_MTD_CFI_INTELEXT case 0x0001: case 0x0003: @@ -246,9 +245,9 @@ static struct mtd_info *check_cmd_set(struct map_info *map, int primary) case 0x0020: return cfi_cmdset_0020(map, primary); #endif + default: + return cfi_cmdset_unknown(map, primary); } - - return cfi_cmdset_unknown(map, primary); } MODULE_LICENSE("GPL"); |