Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Update handling of sysctl stuff when built as modules
details: https://anonhg.NetBSD.org/src/rev/5014bb967893
branches: trunk
changeset: 779500:5014bb967893
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu May 31 16:09:33 2012 +0000
description:
Update handling of sysctl stuff when built as modules
diffstat:
sys/dev/i2c/dbcool.c | 13 +++++++++++--
sys/dev/i2c/spdmem_i2c.c | 9 +++++++--
sys/dev/ic/spdmem.c | 14 ++++++++------
3 files changed, 26 insertions(+), 10 deletions(-)
diffs (138 lines):
diff -r a92920894928 -r 5014bb967893 sys/dev/i2c/dbcool.c
--- a/sys/dev/i2c/dbcool.c Thu May 31 16:08:14 2012 +0000
+++ b/sys/dev/i2c/dbcool.c Thu May 31 16:09:33 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dbcool.c,v 1.36 2012/04/28 17:27:08 wiz Exp $ */
+/* $NetBSD: dbcool.c,v 1.37 2012/05/31 16:09:33 pgoyette Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.36 2012/04/28 17:27:08 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dbcool.c,v 1.37 2012/05/31 16:09:33 pgoyette Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1115,7 +1115,11 @@
SYSCTL_SETUP(sysctl_dbcoolsetup, "sysctl dBCool subtree setup")
{
sysctl_createv(clog, 0, NULL, NULL,
+#ifdef _MODULE
+ 0,
+#else
CTLFLAG_PERMANENT,
+#endif
CTLTYPE_NODE, "hw", NULL,
NULL, 0, NULL, 0,
CTL_HW, CTL_EOL);
@@ -2178,18 +2182,23 @@
dbcool_modcmd(modcmd_t cmd, void *opaque)
{
int error = 0;
+#ifdef _MODULE
+ static struct sysctllog *dbcool_sysctl_clog;
+#endif
switch (cmd) {
case MODULE_CMD_INIT:
#ifdef _MODULE
error = config_init_component(cfdriver_ioconf_dbcool,
cfattach_ioconf_dbcool, cfdata_ioconf_dbcool);
+ sysctl_dbcoolsetup(&dbcool_sysctl_clog);
#endif
return error;
case MODULE_CMD_FINI:
#ifdef _MODULE
error = config_fini_component(cfdriver_ioconf_dbcool,
cfattach_ioconf_dbcool, cfdata_ioconf_dbcool);
+ sysctl_teardown(&dbcool_sysctl_clog);
#endif
return error;
default:
diff -r a92920894928 -r 5014bb967893 sys/dev/i2c/spdmem_i2c.c
--- a/sys/dev/i2c/spdmem_i2c.c Thu May 31 16:08:14 2012 +0000
+++ b/sys/dev/i2c/spdmem_i2c.c Thu May 31 16:09:33 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem_i2c.c,v 1.4 2012/01/22 10:36:52 nakayama Exp $ */
+/* $NetBSD: spdmem_i2c.c,v 1.5 2012/05/31 16:09:33 pgoyette Exp $ */
/*
* Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.4 2012/01/22 10:36:52 nakayama Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.5 2012/05/31 16:09:33 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -145,18 +145,23 @@
spdmem_modcmd(modcmd_t cmd, void *opaque)
{
int error = 0;
+#ifdef _MODULE
+ static struct sysctllog *spdmem_sysctl_clog;
+#endif
switch (cmd) {
case MODULE_CMD_INIT:
#ifdef _MODULE
error = config_init_component(cfdriver_ioconf_spdmem,
cfattach_ioconf_spdmem, cfdata_ioconf_spdmem);
+ sysctl_spdmem_setup(&spdmem_sysctl_clog);
#endif
return error;
case MODULE_CMD_FINI:
#ifdef _MODULE
error = config_fini_component(cfdriver_ioconf_spdmem,
cfattach_ioconf_spdmem, cfdata_ioconf_spdmem);
+ sysctl_teardown(&spdmem_sysctl_clog);
#endif
return error;
default:
diff -r a92920894928 -r 5014bb967893 sys/dev/ic/spdmem.c
--- a/sys/dev/ic/spdmem.c Thu May 31 16:08:14 2012 +0000
+++ b/sys/dev/ic/spdmem.c Thu May 31 16:09:33 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.5 2011/08/19 09:46:10 wiz Exp $ */
+/* $NetBSD: spdmem.c,v 1.6 2012/05/31 16:09:34 pgoyette Exp $ */
/*
* Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.5 2011/08/19 09:46:10 wiz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.6 2012/05/31 16:09:34 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -276,9 +276,6 @@
* Setup our sysctl subtree, hw.spdmemN
*/
sc->sc_sysctl_log = NULL;
-#ifdef _MODULE
- sysctl_spdmem_setup(&sc->sc_sysctl_log);
-#endif
if (hw_node != CTL_EOL)
sysctl_createv(&sc->sc_sysctl_log, 0, NULL, &node,
0, CTLTYPE_NODE,
@@ -401,7 +398,12 @@
{
const struct sysctlnode *node;
- if (sysctl_createv(clog, 0, NULL, &node, CTLFLAG_PERMANENT,
+ if (sysctl_createv(clog, 0, NULL, &node,
+#ifdef _MODULE
+ 0,
+#else
+ CTLFLAG_PERMANENT,
+#endif
CTLTYPE_NODE, "hw", NULL, NULL, 0, NULL, 0,
CTL_HW, CTL_EOL) != 0)
return;
Home |
Main Index |
Thread Index |
Old Index