diff options
author | kn <kn@cvs.openbsd.org> | 2019-06-14 11:57:17 +0000 |
---|---|---|
committer | kn <kn@cvs.openbsd.org> | 2019-06-14 11:57:17 +0000 |
commit | c7715d886024f8ba1190c621dae71c116531fb83 (patch) | |
tree | ea19dc06db6c95b0ea6f2ab6dcccf5907cb5792b /sys/dev/usb | |
parent | 8cb2241924c4049d980dda2a7059e7f80642bf29 (diff) |
Use timeout_add_msec(9)
The timeval is used to represent 100ms, which are converted to Hz so they
can be converted back - simplify this by using the new ms interface
directly.
Tested and OK kevlo
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/if_urtw.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/dev/usb/if_urtw.c b/sys/dev/usb/if_urtw.c index 717f1abd438..17d56c17423 100644 --- a/sys/dev/usb/if_urtw.c +++ b/sys/dev/usb/if_urtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtw.c,v 1.67 2018/01/23 02:53:26 kevlo Exp $ */ +/* $OpenBSD: if_urtw.c,v 1.68 2019/06/14 11:57:16 kn Exp $ */ /*- * Copyright (c) 2009 Martynas Venckus <martynas@openbsd.org> @@ -1835,8 +1835,6 @@ fail: usbd_status urtw_led_mode0(struct urtw_softc *sc, int mode) { - struct timeval t; - switch (mode) { case URTW_LED_CTL_POWER_ON: sc->sc_gpio_ledstate = URTW_LED_POWER_ON_BLINK; @@ -1867,10 +1865,8 @@ urtw_led_mode0(struct urtw_softc *sc, int mode) sc->sc_gpio_ledinprogress = 1; sc->sc_gpio_blinkstate = (sc->sc_gpio_ledon != 0) ? URTW_LED_OFF : URTW_LED_ON; - t.tv_sec = 0; - t.tv_usec = 100 * 1000L; if (!usbd_is_dying(sc->sc_udev)) - timeout_add(&sc->sc_led_ch, tvtohz(&t)); + timeout_add_msec(&sc->sc_led_ch, 100); break; case URTW_LED_POWER_ON_BLINK: urtw_led_on(sc, URTW_LED_GPIO); @@ -1952,7 +1948,6 @@ urtw_led_ctl(struct urtw_softc *sc, int mode) usbd_status urtw_led_blink(struct urtw_softc *sc) { - struct timeval t; uint8_t ing = 0; usbd_status error; @@ -1987,10 +1982,8 @@ urtw_led_blink(struct urtw_softc *sc) switch (sc->sc_gpio_ledstate) { case URTW_LED_BLINK_NORMAL: - t.tv_sec = 0; - t.tv_usec = 100 * 1000L; if (!usbd_is_dying(sc->sc_udev)) - timeout_add(&sc->sc_led_ch, tvtohz(&t)); + timeout_add_msec(&sc->sc_led_ch, 100); break; default: break; |