summaryrefslogtreecommitdiffstats
path: root/sys/dev/digi
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2001-06-18 15:10:20 +0000
committerbrian <brian@FreeBSD.org>2001-06-18 15:10:20 +0000
commit9d7cdee0caf49f464694398c5b692df5cb6eb3b1 (patch)
tree06a47e017af9b7c362e5c70fd1729ba7cb538fe0 /sys/dev/digi
parenta08eb62a0db12d6362d89519e448d374fdbf107f (diff)
downloadFreeBSD-src-9d7cdee0caf49f464694398c5b692df5cb6eb3b1.zip
FreeBSD-src-9d7cdee0caf49f464694398c5b692df5cb6eb3b1.tar.gz
Use linker_reference_module() instead of hard-coding the digi_*
module path.
Diffstat (limited to 'sys/dev/digi')
-rw-r--r--sys/dev/digi/digi.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c
index fca5845..efa2294 100644
--- a/sys/dev/digi/digi.c
+++ b/sys/dev/digi/digi.c
@@ -1030,31 +1030,24 @@ digi_loadmoduledata(struct digi_softc *sc)
linker_file_t lf;
char *modfile, *sym;
caddr_t symptr;
- int res, symlen;
+ int modlen, res;
KASSERT(sc->bios.data == NULL, ("Uninitialised BIOS variable"));
KASSERT(sc->fep.data == NULL, ("Uninitialised FEP variable"));
KASSERT(sc->link.data == NULL, ("Uninitialised LINK variable"));
KASSERT(sc->module != NULL, ("Uninitialised module name"));
- /*-
- * XXX: It'd be nice to have something like linker_search_path()
- * here. For the moment we hardcode things - the comments
- * in linker_load_module() before the call to
- * linker_search_path() suggests that ``there will be a
- * system...''.
- */
- modfile = malloc(MAXPATHLEN, M_TEMP, M_WAITOK);
- snprintf(modfile, MAXPATHLEN, "/boot/kernel/digi_%s.ko", sc->module);
- if ((res = linker_load_file(modfile, &lf)) != 0)
+ modlen = strlen(sc->module);
+ modfile = malloc(modlen + 6, M_TEMP, M_WAITOK);
+ snprintf(modfile, modlen + 6, "digi_%s", sc->module);
+ if ((res = linker_reference_module(modfile, &lf)) != 0)
printf("%s: Failed %d to load module\n", modfile, res);
free(modfile, M_TEMP);
if (res != 0)
return (res);
- symlen = strlen(sc->module) + 10;
- sym = malloc(symlen, M_TEMP, M_WAITOK);
- snprintf(sym, symlen, "digi_mod_%s", sc->module);
+ sym = malloc(modlen + 10, M_TEMP, M_WAITOK);
+ snprintf(sym, modlen + 10, "digi_mod_%s", sc->module);
if ((symptr = linker_file_lookup_symbol(lf, sym, 0)) == NULL)
printf("digi_%s.ko: Symbol `%s' not found\n", sc->module, sym);
free(sym, M_TEMP);
OpenPOWER on IntegriCloud