From 8ad55476a0c93a0bcb9e3363b8a11bd9a5c02883 Mon Sep 17 00:00:00 2001 From: brian Date: Wed, 10 Apr 2002 01:13:57 +0000 Subject: Change linker_reference_module() so that it's passed a struct mod_depend * (which may be NULL). The only consumer of this function at the moment is digi_loadmoduledata(), and that passes a NULL mod_depend *. In linker_reference_module(), check to see if we've already got the required module loaded. If we have, bump the reference count and return that, otherwise continue the module search as normal. --- sys/dev/digi/digi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'sys/dev/digi') diff --git a/sys/dev/digi/digi.c b/sys/dev/digi/digi.c index 90ba01c..18ea046 100644 --- a/sys/dev/digi/digi.c +++ b/sys/dev/digi/digi.c @@ -1028,8 +1028,14 @@ digi_loadmoduledata(struct digi_softc *sc) 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); + if ((res = linker_reference_module(modfile, NULL, &lf)) != 0) { + if (res == ENOENT && rootdev == NODEV) + printf("%s: Failed to autoload module: No filesystem\n", + modfile); + else + printf("%s: Failed %d to autoload module\n", modfile, + res); + } free(modfile, M_TEMP); if (res != 0) return (res); -- cgit v1.1