diff options
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r-- | sys/dev/sbus/stp4020.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/sys/dev/sbus/stp4020.c b/sys/dev/sbus/stp4020.c index 4bf7e912572..8d469dadc2e 100644 --- a/sys/dev/sbus/stp4020.c +++ b/sys/dev/sbus/stp4020.c @@ -1,4 +1,4 @@ -/* $OpenBSD: stp4020.c,v 1.21 2019/12/31 10:05:33 mpi Exp $ */ +/* $OpenBSD: stp4020.c,v 1.22 2020/02/18 00:10:22 cheloha Exp $ */ /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem Exp $ */ /*- @@ -832,23 +832,20 @@ stp4020_chip_intr_string(pcmcia_chipset_handle_t pch, void *ih) * XXX - assumes a context */ void -stp4020_delay(unsigned int ms) +stp4020_delay(unsigned int usecs) { - unsigned int nticks; + int chan; - /* Convert to nticks */ - nticks = (ms * hz) / 1000000; - - if (cold || nticks == 0) { - delay(ms); + if (cold || usecs < tick) { + delay(usecs); return; } #ifdef DEBUG - if (nticks > 60 * hz) - panic("stp4020: preposterous delay: %u", nticks); + if (USEC_TO_NSEC(usecs) > SEC_TO_NSEC(60)) + panic("stp4020: preposterous delay: %uus", usecs); #endif - tsleep(&nticks, 0, "stp4020_delay", nticks); + tsleep_nsec(&chan, 0, "stp4020_delay", USEC_TO_NSEC(usecs)); } #ifdef STP4020_DEBUG |