From f8f40deb66d75bbb63e1476f98a63fead828f952 Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 18 Feb 2020 00:10:23 +0000 Subject: stp(4): tsleep(9) -> tsleep_nsec(9) With input from kn@. Compile-tested by kn@. ok kn@ --- sys/dev/sbus/stp4020.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'sys/dev') 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 -- cgit v1.2.3