diff options
author | kn <kn@cvs.openbsd.org> | 2019-06-26 21:01:21 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2019-06-26 21:01:21 +0000 |
commit | da7dae657652ed9323bcae8cd23bcb821aa34c28 (patch) | |
tree | b1d0c6b6ad175079910952b884bdd36d1cd28dec /sys/dev/pci | |
parent | d3af2ebfc68f6d020c4bd00bc1a6211ef580bdb1 (diff) |
Use timeout_add_msec(9)
To initiate LED blinking, simply kick of the timer after the blinking
rate's period rather than one tick to get red of the last hardclock(9)
based timeout in this driver. The now increased delay is compensated by
also turning on the LED immediately.
OK stsp
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_iwm.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c index a4e087dbb87..ab46b036dfb 100644 --- a/sys/dev/pci/if_iwm.c +++ b/sys/dev/pci/if_iwm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.241 2019/05/09 16:14:14 stsp Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.242 2019/06/26 21:01:20 kn Exp $ */ /* * Copyright (c) 2014, 2016 genua gmbh <info@genua.de> @@ -4454,6 +4454,8 @@ iwm_led_is_enabled(struct iwm_softc *sc) return (IWM_READ(sc, IWM_CSR_LED_REG) == IWM_CSR_LED_REG_TURN_ON); } +#define IWM_LED_BLINK_TIMEOUT_MSEC 200 + void iwm_led_blink_timeout(void *arg) { @@ -4464,13 +4466,14 @@ iwm_led_blink_timeout(void *arg) else iwm_led_enable(sc); - timeout_add_msec(&sc->sc_led_blink_to, 200); + timeout_add_msec(&sc->sc_led_blink_to, IWM_LED_BLINK_TIMEOUT_MSEC); } void iwm_led_blink_start(struct iwm_softc *sc) { - timeout_add(&sc->sc_led_blink_to, 0); + timeout_add_msec(&sc->sc_led_blink_to, IWM_LED_BLINK_TIMEOUT_MSEC); + iwm_led_enable(sc); } void |