diff options
author | Luiz Souza <luiz@netgate.com> | 2017-09-19 21:34:05 -0500 |
---|---|---|
committer | Luiz Souza <luiz@netgate.com> | 2017-09-19 21:35:02 -0500 |
commit | 24d61b94247e55d0259bcc448845eb46a98d3c73 (patch) | |
tree | 6e0988dbd73a2fda1c2c69387b58882cfcfdc61c | |
parent | 1966df7a04f26a96c66c2460bef406eb62ee503f (diff) | |
download | FreeBSD-src-24d61b94247e55d0259bcc448845eb46a98d3c73.zip FreeBSD-src-24d61b94247e55d0259bcc448845eb46a98d3c73.tar.gz |
Fix the the mode of operation sysctl.
(cherry picked from commit 68ac788f00aea4daf0e51b72be45eb528f01f825)
-rw-r--r-- | sys/dev/iicbus/is31fl319x.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/iicbus/is31fl319x.c b/sys/dev/iicbus/is31fl319x.c index 4991348..1ad7f52 100644 --- a/sys/dev/iicbus/is31fl319x.c +++ b/sys/dev/iicbus/is31fl319x.c @@ -113,8 +113,9 @@ is31fl319x_pwm_sysctl(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); - enable = (enable == 0) ? 1 : 0; - sc->sc_conf1 ^= IS31FL319X_CONF1_PWM(led); + sc->sc_conf1 &= ~IS31FL319X_CONF1_PWM(led); + if (enable == 0) + sc->sc_conf1 |= IS31FL319X_CONF1_PWM(led); if (is31fl319x_write(sc->sc_dev, IS31FL319X_CONF1, &sc->sc_conf1, sizeof(sc->sc_conf1)) != 0) return (ENXIO); |