Module Name: src
Committed By: riastradh
Date: Mon Jul 14 14:58:32 UTC 2014
Modified Files:
src/sys/dev/usb: uatp.c
Log Message:
Add module crud to uatp(4).
Compile-tested only; hardware not available right now.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/uatp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/usb/uatp.c
diff -u src/sys/dev/usb/uatp.c:1.8 src/sys/dev/usb/uatp.c:1.9
--- src/sys/dev/usb/uatp.c:1.8 Mon Jul 14 14:56:10 2014
+++ src/sys/dev/usb/uatp.c Mon Jul 14 14:58:32 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: uatp.c,v 1.8 2014/07/14 14:56:10 riastradh Exp $ */
+/* $NetBSD: uatp.c,v 1.9 2014/07/14 14:58:32 riastradh Exp $ */
/*-
* Copyright (c) 2011-2014 The NetBSD Foundation, Inc.
@@ -146,7 +146,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.8 2014/07/14 14:56:10 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.9 2014/07/14 14:58:32 riastradh Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -155,6 +155,7 @@ __KERNEL_RCSID(0, "$NetBSD: uatp.c,v 1.8
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/kernel.h>
+#include <sys/module.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/time.h>
@@ -2645,3 +2646,32 @@ accelerate(struct uatp_softc *sc, unsign
#undef CHECK_
}
+
+MODULE(MODULE_CLASS_DRIVER, uatp, NULL);
+
+#ifdef _MODULE
+#include "ioconf.c"
+#endif
+
+static int
+uatp_modcmd(modcmd_t cmd, void *aux)
+{
+ int error = 0;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+#ifdef _MODULE
+ error = config_init_component(cfdriver_ioconf_uatp,
+ cfattach_ioconf_uatp, cfdata_ioconf_uatp);
+#endif
+ return error;
+ case MODULE_CMD_FINI:
+#ifdef _MODULE
+ error = config_fini_component(cfdriver_ioconf_uatp,
+ cfattach_ioconf_uatp, cfdata_ioconf_uatp);
+#endif
+ return error;
+ default:
+ return ENOTTY;
+ }
+}