Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/isa add module support
details: https://anonhg.NetBSD.org/src/rev/006a520cce67
branches: trunk
changeset: 767761:006a520cce67
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Fri Jul 29 20:58:47 2011 +0000
description:
add module support
diffstat:
sys/dev/isa/itesio_isa.c | 35 ++++++++++++++++++++++++++++++++---
1 files changed, 32 insertions(+), 3 deletions(-)
diffs (57 lines):
diff -r a3fb9e2d5088 -r 006a520cce67 sys/dev/isa/itesio_isa.c
--- a/sys/dev/isa/itesio_isa.c Fri Jul 29 20:58:07 2011 +0000
+++ b/sys/dev/isa/itesio_isa.c Fri Jul 29 20:58:47 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: itesio_isa.c,v 1.22 2011/06/20 18:12:54 pgoyette Exp $ */
+/* $NetBSD: itesio_isa.c,v 1.23 2011/07/29 20:58:47 jmcneill Exp $ */
/* Derived from $OpenBSD: it.c,v 1.19 2006/04/10 00:57:54 deraadt Exp $ */
/*
@@ -34,12 +34,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.22 2011/06/20 18:12:54 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: itesio_isa.c,v 1.23 2011/07/29 20:58:47 jmcneill Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/device.h>
-
+#include <sys/module.h>
#include <sys/bus.h>
#include <dev/isa/isareg.h>
@@ -610,3 +610,32 @@
return 0;
}
+
+MODULE(MODULE_CLASS_DRIVER, itesio, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+itesio_modcmd(modcmd_t cmd, void *opaque)
+{
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+#ifdef _MODULE
+ return config_init_component(cfdriver_ioconf_itesio,
+ cfattach_ioconf_itesio, cfdata_ioconf_itesio);
+#else
+ return 0;
+#endif
+ case MODULE_CMD_FINI:
+#ifdef _MODULE
+ return config_fini_component(cfdriver_ioconf_itesio,
+ cfattach_ioconf_itesio, cfdata_ioconf_itesio);
+#else
+ return 0;
+#endif
+ default:
+ return ENOTTY;
+ }
+}
Home |
Main Index |
Thread Index |
Old Index