diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2001-01-31 07:58:58 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2001-01-31 07:58:58 +0000 |
| commit | 2b12097485448804f5315a84fccc19a39d7d896a (patch) | |
| tree | 9265f95b4e5e9a5d183b143ea48741ecdb0c7050 /sys/dev/fb/fb.c | |
| parent | 0adb9b96bd93545f2fbaf8e82556d6f7300045ea (diff) | |
Notes
Diffstat (limited to 'sys/dev/fb/fb.c')
| -rw-r--r-- | sys/dev/fb/fb.c | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c index 0c354c1900a7..c729e0fd98f3 100644 --- a/sys/dev/fb/fb.c +++ b/sys/dev/fb/fb.c @@ -36,6 +36,7 @@ #include <sys/bus.h> #include <sys/kernel.h> #include <sys/malloc.h> +#include <sys/module.h> #include <sys/uio.h> #include <sys/fbio.h> @@ -374,18 +375,29 @@ static struct cdevsw fb_cdevsw = { /* bmaj */ -1 }; -static void -vfbattach(void *arg) -{ - static int fb_devsw_installed = FALSE; - if (!fb_devsw_installed) { +static int +fb_modevent(module_t mod, int type, void *data) +{ + + switch (type) { + case MOD_LOAD: cdevsw_add(&fb_cdevsw); - fb_devsw_installed = TRUE; - } -} + break; + case MOD_UNLOAD: + printf("fb module unload - not possible for this module type\n"); + return EINVAL; + } + return 0; +} + +static moduledata_t fb_mod = { + "fb", + fb_modevent, + NULL +}; -PSEUDO_SET(vfbattach, fb); +DECLARE_MODULE(fb, fb_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); int fb_attach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) |
