Ticks to microseconds.

The parameter name "ms" is misleading.  All the calling code uses
microseconds.  I think the author's thought process in choosing that
name was roughly: "microseconds" -> "Micro Seconds" -> "ms".

In any case, I've renamed the parameter to the less misleading
"usecs".

This driver is only built on sparc64.  I think this ought to compile.
If someone could confirm that it compiles that would help.

If someone has one of these things that would be even better, though I
have my doubts.

ok?

Index: stp4020.c
===================================================================
RCS file: /cvs/src/sys/dev/sbus/stp4020.c,v
retrieving revision 1.21
diff -u -p -r1.21 stp4020.c
--- stp4020.c   31 Dec 2019 10:05:33 -0000      1.21
+++ stp4020.c   10 Feb 2020 23:20:59 -0000
@@ -832,23 +832,20 @@ stp4020_chip_intr_string(pcmcia_chipset_
  * 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 (usecs > 60 * 1000000)
+               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

Reply via email to