From 6be84866ea66a3d9041f0400dda21d05913d219d Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 31 Jan 2001 07:58:58 +0000 Subject: Exterminate the use of PSEUDO_SET() with extreme prejudice. --- sys/dev/fb/fb.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'sys/dev/fb/fb.c') diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c index 0c354c1..c729e0f 100644 --- a/sys/dev/fb/fb.c +++ b/sys/dev/fb/fb.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -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) { - cdevsw_add(&fb_cdevsw); - fb_devsw_installed = TRUE; - } -} +static int +fb_modevent(module_t mod, int type, void *data) +{ -PSEUDO_SET(vfbattach, fb); + switch (type) { + case MOD_LOAD: + cdevsw_add(&fb_cdevsw); + 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 +}; + +DECLARE_MODULE(fb, fb_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); int fb_attach(dev_t dev, video_adapter_t *adp, struct cdevsw *cdevsw) -- cgit v1.1