summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2020-01-13 10:01:25 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2020-01-13 10:01:25 +0000
commit51d7d8baab89f4e3a59692afdfc0b33bac7009dc (patch)
treeda84843690e1205326b4a407438c6bd80ce8f50c /sys/dev/usb
parentef7a18a9164199d9f670fc7ea73fa6a87a6e7d7a (diff)
Convert to tsleep_nsec(9).
ok kettenis@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/uthum.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/uthum.c b/sys/dev/usb/uthum.c
index 2cb06ee8064..4af3648e402 100644
--- a/sys/dev/usb/uthum.c
+++ b/sys/dev/usb/uthum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthum.c,v 1.32 2017/01/09 14:44:28 mpi Exp $ */
+/* $OpenBSD: uthum.c,v 1.33 2020/01/13 10:01:24 mpi Exp $ */
/*
* Copyright (c) 2009, 2010 Yojiro UO <yuo@nui.org>
@@ -311,7 +311,8 @@ uthum_issue_cmd(struct uthum_softc *sc, uint8_t target_cmd, int delay)
/* wait if required */
if (delay > 0)
- tsleep(&sc->sc_sensortask, 0, "uthum", (delay*hz+999)/1000 + 1);
+ tsleep_nsec(&sc->sc_sensortask, 0, "uthum",
+ MSEC_TO_NSEC(delay));
return 0;
}
@@ -337,7 +338,8 @@ uthum_read_data(struct uthum_softc *sc, uint8_t target_cmd, uint8_t *buf,
/* wait if required */
if (delay > 0)
- tsleep(&sc->sc_sensortask, 0, "uthum", (delay*hz+999)/1000 + 1);
+ tsleep_nsec(&sc->sc_sensortask, 0, "uthum",
+ MSEC_TO_NSEC(delay));
/* get answer */
if (uhidev_get_report(sc->sc_hdev.sc_parent, UHID_FEATURE_REPORT,