summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2007-06-28 06:22:40 +0000
committerimp <imp@FreeBSD.org>2007-06-28 06:22:40 +0000
commitf98f291a463a1f84be14fd7c128db4a88742c6f9 (patch)
treee4bbb8d6e36992bc5aa0aa3f13b5540172befd96 /sys
parenta305231f8c433112c654595e94a0e0a2251fdfc5 (diff)
downloadFreeBSD-src-f98f291a463a1f84be14fd7c128db4a88742c6f9.zip
FreeBSD-src-f98f291a463a1f84be14fd7c128db4a88742c6f9.tar.gz
The timeout is in milliseconds, not in hz. Only the portion of the
patch that converts ms to ticks was used. Another PR states that a return code of 0 is the right one for libusb. Submitted by: Lonnie Mendez PR: 94311 Approved by: re (blanket)
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/usb/ugen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/ugen.c b/sys/dev/usb/ugen.c
index 50fed1f..a63422f 100644
--- a/sys/dev/usb/ugen.c
+++ b/sys/dev/usb/ugen.c
@@ -715,7 +715,7 @@ 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);
+ (sce->timeout * hz + 999) / 1000);
sce->state &= ~UGEN_ASLP;
DPRINTFN(5, ("ugenread: woke, error=%d\n", error));
if (sc->sc_dying)
@@ -785,7 +785,7 @@ 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);
+ (sce->timeout * hz + 999) / 1000);
sce->state &= ~UGEN_ASLP;
DPRINTFN(5, ("ugenread: woke, error=%d\n", error));
if (sc->sc_dying)
OpenPOWER on IntegriCloud