aboutsummaryrefslogtreecommitdiff
path: root/usb-linux.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2011-05-16 10:34:53 +0200
committerGerd Hoffmann <kraxel@redhat.com>2011-05-26 11:55:03 +0200
commiteb5e680ae5a72b999946e5618c501648367734a8 (patch)
tree906f6b56e9837ae4f1fad70ee7ee878a90d63319 /usb-linux.c
parent4ff658fb6c4f1cb7f771b16f808547e4f5767d02 (diff)
usb: move cancel callback to USBDeviceInfo
Remove the cancel callback from the USBPacket struct, move it over to USBDeviceInfo. Zap usb_defer_packet() which is obsolete now. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'usb-linux.c')
-rw-r--r--usb-linux.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usb-linux.c b/usb-linux.c
index c7e96c3e63..baa6574ef5 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -335,9 +335,9 @@ static void async_complete(void *opaque)
}
}
-static void async_cancel(USBPacket *p, void *opaque)
+static void usb_host_async_cancel(USBDevice *dev, USBPacket *p)
{
- USBHostDevice *s = opaque;
+ USBHostDevice *s = DO_UPCAST(USBHostDevice, dev, dev);
AsyncURB *aurb;
QLIST_FOREACH(aurb, &s->aurbs, next) {
@@ -736,7 +736,6 @@ static int usb_host_handle_data(USBDevice *dev, USBPacket *p)
}
}
- usb_defer_packet(p, async_cancel, s);
return USB_RET_ASYNC;
}
@@ -868,7 +867,6 @@ static int usb_host_handle_control(USBDevice *dev, USBPacket *p,
}
}
- usb_defer_packet(p, async_cancel, s);
return USB_RET_ASYNC;
}
@@ -1197,6 +1195,7 @@ static struct USBDeviceInfo usb_host_dev_info = {
.qdev.size = sizeof(USBHostDevice),
.init = usb_host_initfn,
.handle_packet = usb_generic_handle_packet,
+ .cancel_packet = usb_host_async_cancel,
.handle_data = usb_host_handle_data,
.handle_control = usb_host_handle_control,
.handle_reset = usb_host_handle_reset,