summaryrefslogtreecommitdiffstats
path: root/sys/dev/joy
diff options
context:
space:
mode:
authordufault <dufault@FreeBSD.org>1997-04-06 11:14:13 +0000
committerdufault <dufault@FreeBSD.org>1997-04-06 11:14:13 +0000
commite62e4c624ae75b13f1812862aa5ffc194f1921a4 (patch)
tree42f3ce7dddb1f896f895a6fd33ad3a2b58ecf4b1 /sys/dev/joy
parent7485dac765253c701a97a0ecb94fefd223c9ea62 (diff)
downloadFreeBSD-src-e62e4c624ae75b13f1812862aa5ffc194f1921a4.zip
FreeBSD-src-e62e4c624ae75b13f1812862aa5ffc194f1921a4.tar.gz
Make MOD_* macros almost consistent:
Use the name argument almost the same in all LKM types. Maintain the current behavior for the external (e.g., modstat) name for DEV, EXEC, and MISC types being #name ## "_mod" and SYCALL and VFS only #name. This is a candidate for change and I vote just the name without the "_mod". Change the DISPATCH macro to MOD_DISPATCH for consistency with the other macros. Add an LKM_ANON #define to eliminate the magic -1 and associated signed/unsigned warnings. Add MOD_PRIVATE to support wcd.c's poking around in the lkm structure. Change source in tree to use the new interface. Reviewed by: Bruce Evans
Diffstat (limited to 'sys/dev/joy')
-rw-r--r--sys/dev/joy/joy.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/dev/joy/joy.c b/sys/dev/joy/joy.c
index 5f6ca2e..9675e79 100644
--- a/sys/dev/joy/joy.c
+++ b/sys/dev/joy/joy.c
@@ -259,7 +259,7 @@ MOD_DEV (joy, LM_DT_CHAR, CDEV_MAJOR, &joy_cdevsw);
static struct isa_device dev = {0, &joydriver, IO_GAME, 0, -1, (caddr_t) 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0};
-int
+static int
joy_load (struct lkm_table *lkmtp, int cmd)
{
if (joyprobe (&dev)) {
@@ -273,22 +273,24 @@ joy_load (struct lkm_table *lkmtp, int cmd)
}
}
-int
+static int
joy_unload (struct lkm_table *lkmtp, int cmd)
{
uprintf ("Joystick driver unloaded\n");
return 0;
}
-int
+
+static int
joy_stat (struct lkm_table *lkmtp, int cmd)
{
return 0;
}
+
int
joy_mod (struct lkm_table *lkmtp, int cmd, int ver)
{
-#define _module joy_module
- DISPATCH(lkmtp, cmd, ver, joy_load, joy_unload, joy_stat);
+ MOD_DISPATCH(joy, lkmtp, cmd, ver,
+ joy_load, joy_unload, joy_stat);
}
#endif /* JOY_MODULE */
OpenPOWER on IntegriCloud