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)
This commit is contained in:
Warner Losh 2007-06-28 06:22:40 +00:00
parent f8f10e94cf
commit 9729910999
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171076

View File

@ -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)