aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/bus.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-02-21 18:14:45 +0400
committerGerd Hoffmann <kraxel@redhat.com>2017-02-23 15:40:19 +0100
commitc4fe9700e6bb769059608f768d2efd3d80a69630 (patch)
tree4ea9be9088a26b520d9043785dab4ba2d1045b98 /hw/usb/bus.c
parent796b288f7be875045670f963ce99991b3c8e96ac (diff)
downloadqemu-c4fe9700e6bb769059608f768d2efd3d80a69630.zip
qemu-c4fe9700e6bb769059608f768d2efd3d80a69630.tar.gz
qemu-c4fe9700e6bb769059608f768d2efd3d80a69630.tar.bz2
usb: replace handle_destroy with unrealize
Curiously, unrealize() is not being used, but it seems more appropriate than handle_destroy() together with realize(). It is more ubiquitous destroy name in qemu code base and may throw errors. Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20170221141451.28305-25-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/bus.c')
-rw-r--r--hw/usb/bus.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/usb/bus.c b/hw/usb/bus.c
index 1dcc35c..efe4b8e 100644
--- a/hw/usb/bus.c
+++ b/hw/usb/bus.c
@@ -136,11 +136,12 @@ USBDevice *usb_device_find_device(USBDevice *dev, uint8_t addr)
return NULL;
}
-static void usb_device_handle_destroy(USBDevice *dev)
+static void usb_device_unrealize(USBDevice *dev, Error **errp)
{
USBDeviceClass *klass = USB_DEVICE_GET_CLASS(dev);
- if (klass->handle_destroy) {
- klass->handle_destroy(dev);
+
+ if (klass->unrealize) {
+ klass->unrealize(dev, errp);
}
}
@@ -291,7 +292,7 @@ static void usb_qdev_unrealize(DeviceState *qdev, Error **errp)
if (dev->attached) {
usb_device_detach(dev);
}
- usb_device_handle_destroy(dev);
+ usb_device_unrealize(dev, errp);
if (dev->port) {
usb_release_port(dev);
}