diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-01-04 11:37:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2020-01-04 11:37:34 +0000 |
commit | b570324fa2261a50d102e10842d64434f9630dc4 (patch) | |
tree | 729940ce7cb6323b9c450ef9c9a0ee036ee8202d /sys | |
parent | f32572686cbac8f0ffb25225261c907fedf271bf (diff) |
Convert sleep to tsleep_nsec(9) and use unique sleeping identifiers.
ok bluhm@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/ugen.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c index 1b103430ddf..7c2cd6d8178 100644 --- a/sys/dev/usb/ugen.c +++ b/sys/dev/usb/ugen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugen.c,v 1.100 2019/12/31 13:48:31 visa Exp $ */ +/* $OpenBSD: ugen.c,v 1.101 2020/01/04 11:37:33 mpi Exp $ */ /* $NetBSD: ugen.c,v 1.63 2002/11/26 18:49:48 christos Exp $ */ /* $FreeBSD: src/sys/dev/usb/ugen.c,v 1.26 1999/11/17 22:33:41 n_hibma Exp $ */ @@ -510,8 +510,8 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) } sce->state |= UGEN_ASLP; DPRINTFN(5, ("ugenread: sleep on %p\n", sce)); - error = tsleep(sce, PZERO | PCATCH, "ugenri", - (sce->timeout * hz) / 1000); + error = tsleep_nsec(sce, PZERO | PCATCH, "ugenrintr", + MSEC_TO_NSEC(sce->timeout)); sce->state &= ~UGEN_ASLP; DPRINTFN(5, ("ugenread: woke, error=%d\n", error)); if (usbd_is_dying(sc->sc_udev)) @@ -582,8 +582,8 @@ ugen_do_read(struct ugen_softc *sc, int endpt, struct uio *uio, int flag) } sce->state |= UGEN_ASLP; DPRINTFN(5, ("ugenread: sleep on %p\n", sce)); - error = tsleep(sce, PZERO | PCATCH, "ugenri", - (sce->timeout * hz) / 1000); + error = tsleep_nsec(sce, PZERO | PCATCH, "ugenriso", + MSEC_TO_NSEC(sce->timeout)); sce->state &= ~UGEN_ASLP; DPRINTFN(5, ("ugenread: woke, error=%d\n", error)); if (usbd_is_dying(sc->sc_udev)) |