diff options
Diffstat (limited to 'sys/dev/fb')
| -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 0c354c1900a7b..c729e0fd98f34 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) |
