summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb/fb.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2001-01-31 07:58:58 +0000
committerpeter <peter@FreeBSD.org>2001-01-31 07:58:58 +0000
commit6be84866ea66a3d9041f0400dda21d05913d219d (patch)
tree126edfdf3ed82891788fa9edc2df5bada88d2592 /sys/dev/fb/fb.c
parent2c2377c37d343b47ad9d996ea324576e1977647d (diff)
downloadFreeBSD-src-6be84866ea66a3d9041f0400dda21d05913d219d.zip
FreeBSD-src-6be84866ea66a3d9041f0400dda21d05913d219d.tar.gz
Exterminate the use of PSEUDO_SET() with extreme prejudice.
Diffstat (limited to 'sys/dev/fb/fb.c')
-rw-r--r--sys/dev/fb/fb.c32
1 files changed, 22 insertions, 10 deletions
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 <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) {
- 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)
OpenPOWER on IntegriCloud