summaryrefslogtreecommitdiffstats
path: root/sys/dev/nand
diff options
context:
space:
mode:
authorgjb <gjb@FreeBSD.org>2014-06-27 22:05:21 +0000
committergjb <gjb@FreeBSD.org>2014-06-27 22:05:21 +0000
commitfc21f40567ac7485e9e987cf5a539bd0d11c7155 (patch)
treefce5301b062a855bc68b9cb76c6b5966c5a2acbe /sys/dev/nand
parent2f456747e010bfa5a9dd3498aa5650e0ade39f22 (diff)
downloadFreeBSD-src-fc21f40567ac7485e9e987cf5a539bd0d11c7155.zip
FreeBSD-src-fc21f40567ac7485e9e987cf5a539bd0d11c7155.tar.gz
Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output, such as: 1) no output from sysctl(8) 2) erroneously returning ENOMEM with tools like truss(1) or uname(1) truss: can not get etype: Cannot allocate memory
Diffstat (limited to 'sys/dev/nand')
-rw-r--r--sys/dev/nand/nand.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/nand/nand.c b/sys/dev/nand/nand.c
index 113953e..fb83e67 100644
--- a/sys/dev/nand/nand.c
+++ b/sys/dev/nand/nand.c
@@ -65,9 +65,18 @@ __FBSDID("$FreeBSD$");
#define SOFTECC_BYTES 3
int nand_debug_flag = 0;
-SYSCTL_INT(_debug, OID_AUTO, nand_debug, CTLFLAG_RWTUN, &nand_debug_flag, 0,
+SYSCTL_INT(_debug, OID_AUTO, nand_debug, CTLFLAG_RW, &nand_debug_flag, 0,
"NAND subsystem debug flag");
+static void
+nand_tunable_init(void *arg)
+{
+
+ TUNABLE_INT_FETCH("debug.nand", &nand_debug_flag);
+}
+
+SYSINIT(nand_tunables, SI_SUB_VFS, SI_ORDER_ANY, nand_tunable_init, NULL);
+
MALLOC_DEFINE(M_NAND, "NAND", "NAND dynamic data");
static void calculate_ecc(const uint8_t *, uint8_t *);
OpenPOWER on IntegriCloud