Date: Fri, 15 Jun 2018 17:29:32 +0000 (UTC) From: Kyle Evans <kevans@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335220 - head/sys/dev/extres/regulator Message-ID: <201806151729.w5FHTWUA042871@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kevans Date: Fri Jun 15 17:29:32 2018 New Revision: 335220 URL: https://svnweb.freebsd.org/changeset/base/335220 Log: 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 Modified: head/sys/dev/extres/regulator/regulator.c Modified: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- head/sys/dev/extres/regulator/regulator.c Fri Jun 15 17:16:27 2018 (r335219) +++ head/sys/dev/extres/regulator/regulator.c Fri Jun 15 17:29:32 2018 (r335220) @@ -379,15 +379,15 @@ regnode_create(device_t pdev, regnode_class_t regnode_ OID_AUTO, "enable_cnt", CTLFLAG_RD, ®node->enable_cnt, 0, "The regulator enable counter"); - SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_ADD_U8(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "boot_on", - CTLFLAG_RD, (int *) ®node->std_param.boot_on, 0, + CTLFLAG_RD, (uint8_t *) ®node->std_param.boot_on, 0, "Is enabled on boot"); - SYSCTL_ADD_INT(®node->sysctl_ctx, + SYSCTL_ADD_U8(®node->sysctl_ctx, SYSCTL_CHILDREN(regnode_oid), OID_AUTO, "always_on", - CTLFLAG_RD, (int *)®node->std_param.always_on, 0, + CTLFLAG_RD, (uint8_t *)®node->std_param.always_on, 0, "Is always enabled"); SYSCTL_ADD_PROC(®node->sysctl_ctx,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806151729.w5FHTWUA042871>