summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcheloha <cheloha@cvs.openbsd.org>2020-04-06 19:03:10 +0000
committercheloha <cheloha@cvs.openbsd.org>2020-04-06 19:03:10 +0000
commitf78bdcc26b98be0f776c03911adb7c6f4737962c (patch)
treec5f3db04205f5e9b18a90db325d84c397e018d81
parentc6556f77dbb4a5c86905a03aa279ae2597ad28b7 (diff)
sunkbd(4): timeout_add(9) -> timeout_add_msec(9); ok kettenis@
-rw-r--r--sys/dev/sun/sunkbd.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/dev/sun/sunkbd.c b/sys/dev/sun/sunkbd.c
index c2fd94738a0..03d3f91ec44 100644
--- a/sys/dev/sun/sunkbd.c
+++ b/sys/dev/sun/sunkbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunkbd.c,v 1.27 2016/03/19 11:41:56 mpi Exp $ */
+/* $OpenBSD: sunkbd.c,v 1.28 2020/04/06 19:03:09 cheloha Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -84,7 +84,7 @@ sunkbd_attach(struct sunkbd_softc *sc, struct wskbddev_attach_args *waa)
void
sunkbd_bell(struct sunkbd_softc *sc, u_int period, u_int pitch, u_int volume)
{
- int nticks, s;
+ int s;
u_int8_t c = SKBD_CMD_BELLON;
#if NTCTRL > 0
@@ -103,14 +103,10 @@ sunkbd_bell(struct sunkbd_softc *sc, u_int period, u_int pitch, u_int volume)
return;
}
if (sc->sc_bellactive == 0) {
- nticks = (period * hz) / 1000;
- if (nticks <= 0)
- nticks = 1;
-
sc->sc_bellactive = 1;
sc->sc_belltimeout = 1;
(*sc->sc_sendcmd)(sc, &c, 1);
- timeout_add(&sc->sc_bellto, nticks);
+ timeout_add_msec(&sc->sc_bellto, period);
}
splx(s);
}