summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_athn_usb.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2019-11-12 07:47:30 +0000
committermpi <mpi@openbsd.org>2019-11-12 07:47:30 +0000
commit00f6cb327f0c3a51dca118f7da99a4a90b453984 (patch)
tree26813ec3c11c510f6957bf65266529726da18ac8 /sys/dev/usb/if_athn_usb.c
parentDefault to 0 arguments if no symbol has been found in the CTF section. (diff)
downloadwireguard-openbsd-00f6cb327f0c3a51dca118f7da99a4a90b453984.tar.xz
wireguard-openbsd-00f6cb327f0c3a51dca118f7da99a4a90b453984.zip
Convert tsleep(9) that wait for a multiple of `hz' to tsleep_nsec(9).
ok cheloha@
Diffstat (limited to 'sys/dev/usb/if_athn_usb.c')
-rw-r--r--sys/dev/usb/if_athn_usb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/usb/if_athn_usb.c b/sys/dev/usb/if_athn_usb.c
index 83f39f3a748..0c0d06b6d86 100644
--- a/sys/dev/usb/if_athn_usb.c
+++ b/sys/dev/usb/if_athn_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_athn_usb.c,v 1.53 2019/09/12 12:55:07 stsp Exp $ */
+/* $OpenBSD: if_athn_usb.c,v 1.54 2019/11/12 07:47:30 mpi Exp $ */
/*-
* Copyright (c) 2011 Damien Bergamini <damien.bergamini@free.fr>
@@ -694,7 +694,8 @@ athn_usb_load_firmware(struct athn_usb_softc *usc)
error = usbd_do_request(usc->sc_udev, &req, NULL);
/* Wait at most 1 second for firmware to boot. */
if (error == 0 && usc->wait_msg_id != 0)
- error = tsleep(&usc->wait_msg_id, 0, "athnfw", hz);
+ error = tsleep_nsec(&usc->wait_msg_id, 0, "athnfw",
+ SEC_TO_NSEC(1));
usc->wait_msg_id = 0;
splx(s);
return (error);
@@ -779,7 +780,8 @@ athn_usb_htc_setup(struct athn_usb_softc *usc)
usc->wait_msg_id = AR_HTC_MSG_CONF_PIPE_RSP;
error = athn_usb_htc_msg(usc, AR_HTC_MSG_CONF_PIPE, &cfg, sizeof(cfg));
if (error == 0 && usc->wait_msg_id != 0)
- error = tsleep(&usc->wait_msg_id, 0, "athnhtc", hz);
+ error = tsleep_nsec(&usc->wait_msg_id, 0, "athnhtc",
+ SEC_TO_NSEC(1));
usc->wait_msg_id = 0;
splx(s);
if (error != 0) {
@@ -815,7 +817,8 @@ athn_usb_htc_connect_svc(struct athn_usb_softc *usc, uint16_t svc_id,
error = athn_usb_htc_msg(usc, AR_HTC_MSG_CONN_SVC, &msg, sizeof(msg));
/* Wait at most 1 second for response. */
if (error == 0 && usc->wait_msg_id != 0)
- error = tsleep(&usc->wait_msg_id, 0, "athnhtc", hz);
+ error = tsleep_nsec(&usc->wait_msg_id, 0, "athnhtc",
+ SEC_TO_NSEC(1));
usc->wait_msg_id = 0;
splx(s);
if (error != 0) {