summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2020-02-18 00:10:23 +0000
committercheloha <cheloha@cvs.openbsd.org>2020-02-18 00:10:23 +0000
commitf8f40deb66d75bbb63e1476f98a63fead828f952 (patch)
treea495253b61f896f93651f916a20eb1f8adfc3dc4 /sys
parent2773e62c3406bb2fff2e7788bca892526f6fffd6 (diff)
stp(4): tsleep(9) -> tsleep_nsec(9)
With input from kn@. Compile-tested by kn@. ok kn@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sbus/stp4020.c19
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