summaryrefslogtreecommitdiff
path: root/usb-linux.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-07-19 18:06:15 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-07-19 18:06:15 +0000
commit059809e45160fda714edf645902db95e262886e9 (patch)
tree06c7c0c578bbbf43e8c8d843c61a63dec484dd4e /usb-linux.c
parent3b2ccc57c74a3a7405dabd36f7abacd3eff46b46 (diff)
downloadqemu-059809e45160fda714edf645902db95e262886e9.tar.gz
usb destroy API change (Lonnie Mendez)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2066 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'usb-linux.c')
-rw-r--r--usb-linux.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/usb-linux.c b/usb-linux.c
index 420382be92..0a13753d48 100644
--- a/usb-linux.c
+++ b/usb-linux.c
@@ -58,16 +58,8 @@ typedef struct USBHostDevice {
int fd;
} USBHostDevice;
-static void usb_host_handle_reset(USBDevice *dev, int destroy)
+static void usb_host_handle_reset(USBDevice *dev)
{
- USBHostDevice *s = (USBHostDevice *)dev;
-
- if (destroy) {
- if (s->fd >= 0)
- close(s->fd);
- qemu_free(s);
- return;
- }
#if 0
USBHostDevice *s = (USBHostDevice *)dev;
/* USBDEVFS_RESET, but not the first time as it has already be
@@ -76,6 +68,15 @@ static void usb_host_handle_reset(USBDevice *dev, int destroy)
#endif
}
+static void usb_host_handle_destroy(USBDevice *dev)
+{
+ USBHostDevice *s = (USBHostDevice *)dev;
+
+ if (s->fd >= 0)
+ close(s->fd);
+ qemu_free(s);
+}
+
static int usb_host_handle_control(USBDevice *dev,
int request,
int value,
@@ -244,6 +245,7 @@ USBDevice *usb_host_device_open(const char *devname)
dev->dev.handle_reset = usb_host_handle_reset;
dev->dev.handle_control = usb_host_handle_control;
dev->dev.handle_data = usb_host_handle_data;
+ dev->dev.handle_destroy = usb_host_handle_destroy;
if (product_name[0] == '\0')
snprintf(dev->dev.devname, sizeof(dev->dev.devname),