aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2018-06-15 17:29:32 +0000
committerKyle Evans <kevans@FreeBSD.org>2018-06-15 17:29:32 +0000
commite937d05124032e2516f1360601f02038bf2ef3e0 (patch)
treef73b4ba0bbb0983d7ef0f8c2653226cc999a5ef9
parent2f9cfbc6f3a70bf32ddea1d5de902a3ce560316c (diff)
downloadsrc-e937d05124032e2516f1360601f02038bf2ef3e0.tar.gz
src-e937d05124032e2516f1360601f02038bf2ef3e0.zip
extres/regulator: Switch boot_on/always_on sysctl to uint8
These are represented as booleans on the kernel-side, but were being exposed as int. This was causing some funky things to happen when read later with sysctl(8), e.g. randomly reading super-high when the value was actually '0'/false. Reviewed by: manu
Notes
Notes: svn path=/head/; revision=335220
-rw-r--r--sys/dev/extres/regulator/regulator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/extres/regulator/regulator.c b/sys/dev/extres/regulator/regulator.c
index fa294867b571..c57d78dd5ca1 100644
--- a/sys/dev/extres/regulator/regulator.c
+++ b/sys/dev/extres/regulator/regulator.c
@@ -379,15 +379,15 @@ regnode_create(device_t pdev, regnode_class_t regnode_class,
OID_AUTO, "enable_cnt",
CTLFLAG_RD, &regnode->enable_cnt, 0,
"The regulator enable counter");
- SYSCTL_ADD_INT(&regnode->sysctl_ctx,
+ SYSCTL_ADD_U8(&regnode->sysctl_ctx,
SYSCTL_CHILDREN(regnode_oid),
OID_AUTO, "boot_on",
- CTLFLAG_RD, (int *) &regnode->std_param.boot_on, 0,
+ CTLFLAG_RD, (uint8_t *) &regnode->std_param.boot_on, 0,
"Is enabled on boot");
- SYSCTL_ADD_INT(&regnode->sysctl_ctx,
+ SYSCTL_ADD_U8(&regnode->sysctl_ctx,
SYSCTL_CHILDREN(regnode_oid),
OID_AUTO, "always_on",
- CTLFLAG_RD, (int *)&regnode->std_param.always_on, 0,
+ CTLFLAG_RD, (uint8_t *)&regnode->std_param.always_on, 0,
"Is always enabled");
SYSCTL_ADD_PROC(&regnode->sysctl_ctx,