diff options
author | ian <ian@FreeBSD.org> | 2017-09-11 02:56:45 +0000 |
---|---|---|
committer | ian <ian@FreeBSD.org> | 2017-09-11 02:56:45 +0000 |
commit | 5e086df6b080291fa4c6478eaf4dc67ca7ddf53e (patch) | |
tree | 1c92822d4f7d19d1c7c300d1a564c941871efb4e | |
parent | 2ad79ef5a7a981438060e81bae99b9df722ec62a (diff) | |
download | FreeBSD-src-5e086df6b080291fa4c6478eaf4dc67ca7ddf53e.zip FreeBSD-src-5e086df6b080291fa4c6478eaf4dc67ca7ddf53e.tar.gz |
MFC r320743:
Fix drivers that assume ticks starts at zero. These drivers all have logic
similar to "if (ticks > localvar+interval) {localvar=ticks; ...}" where
localvar is initialized to zero. Ticks is initialized to a negative value
since r278230, and that leads to these if statements never being true.
-rw-r--r-- | sys/dev/bwi/if_bwi.c | 1 | ||||
-rw-r--r-- | sys/dev/iicbus/ad7418.c | 2 | ||||
-rw-r--r-- | sys/dev/iwi/if_iwi.c | 1 |
3 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/bwi/if_bwi.c b/sys/dev/bwi/if_bwi.c index 47717fc..991071b 100644 --- a/sys/dev/bwi/if_bwi.c +++ b/sys/dev/bwi/if_bwi.c @@ -381,6 +381,7 @@ bwi_attach(struct bwi_softc *sc) */ sc->sc_fw_version = BWI_FW_VERSION3; sc->sc_led_idle = (2350 * hz) / 1000; + sc->sc_led_ticks = ticks - sc->sc_led_idle; sc->sc_led_blink = 1; sc->sc_txpwr_calib = 1; #ifdef BWI_DEBUG diff --git a/sys/dev/iicbus/ad7418.c b/sys/dev/iicbus/ad7418.c index dcb8b95..82a8018 100644 --- a/sys/dev/iicbus/ad7418.c +++ b/sys/dev/iicbus/ad7418.c @@ -120,6 +120,8 @@ ad7418_attach(device_t dev) int conf; sc->sc_dev = dev; + sc->sc_lastupdate = ticks - hz; + sx_init(&sc->sc_lock, "ad7418"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 8e049e3..4b3454f 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -286,6 +286,7 @@ iwi_attach(device_t dev) int i, error; sc->sc_dev = dev; + sc->sc_ledevent = ticks; IWI_LOCK_INIT(sc); mbufq_init(&sc->sc_snd, ifqmaxlen); |