summaryrefslogtreecommitdiffstats
path: root/sys/dev/sun
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2020-04-06 19:03:09 +0000
committercheloha <cheloha@openbsd.org>2020-04-06 19:03:09 +0000
commitf0cdf84b2ddcee98f5a05c229aef4efc8fb72fd6 (patch)
tree5e993b33c7fd9a7fbda3bcbf9c5f417923eebaf4 /sys/dev/sun
parentpcppi(4), spkr(4): ticks -> milliseconds (diff)
downloadwireguard-openbsd-f0cdf84b2ddcee98f5a05c229aef4efc8fb72fd6.tar.xz
wireguard-openbsd-f0cdf84b2ddcee98f5a05c229aef4efc8fb72fd6.zip
sunkbd(4): timeout_add(9) -> timeout_add_msec(9); ok kettenis@
Diffstat (limited to 'sys/dev/sun')
-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);
}