summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/usb/usbdi.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c
index 0f5f50e39ca..cbc1b536028 100644
--- a/sys/dev/usb/usbdi.c
+++ b/sys/dev/usb/usbdi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: usbdi.c,v 1.36 2008/06/26 05:42:19 ray Exp $ */
+/* $OpenBSD: usbdi.c,v 1.37 2008/10/11 13:51:35 mglocker Exp $ */
/* $NetBSD: usbdi.c,v 1.103 2002/09/27 15:37:38 provos Exp $ */
/* $FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $ */
@@ -801,17 +801,15 @@ usb_transfer_complete(usbd_xfer_handle xfer)
xfer->status = USBD_SHORT_XFER;
}
- if (xfer->callback)
- xfer->callback(xfer, xfer->priv, xfer->status);
-
-#ifdef DIAGNOSTIC
- if (pipe->methods->done != NULL)
+ if (repeat) {
+ if (xfer->callback)
+ xfer->callback(xfer, xfer->priv, xfer->status);
pipe->methods->done(xfer);
- else
- printf("usb_transfer_complete: pipe->methods->done == NULL\n");
-#else
- pipe->methods->done(xfer);
-#endif
+ } else {
+ pipe->methods->done(xfer);
+ if (xfer->callback)
+ xfer->callback(xfer, xfer->priv, xfer->status);
+ }
if ((xfer->flags & USBD_SYNCHRONOUS) && !polling)
wakeup(xfer);