summaryrefslogtreecommitdiff
path: root/hw/usb-bus.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-09-16 22:25:29 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-10-05 09:32:46 -0500
commitb2317837f0dadd845b33d528a940adb658b669b9 (patch)
tree07b668610459f04f1edb78243f2888e616159977 /hw/usb-bus.c
parentca9c39faed928405574d234b4f7c5704cd2c568e (diff)
switch usb bus to inplace allocation.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/usb-bus.c')
-rw-r--r--hw/usb-bus.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index 03933f12f1..2cac1e85b7 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -14,16 +14,13 @@ static struct BusInfo usb_bus_info = {
static int next_usb_bus = 0;
static QTAILQ_HEAD(, USBBus) busses = QTAILQ_HEAD_INITIALIZER(busses);
-USBBus *usb_bus_new(DeviceState *host)
+void usb_bus_new(USBBus *bus, DeviceState *host)
{
- USBBus *bus;
-
- bus = FROM_QBUS(USBBus, qbus_create(&usb_bus_info, host, NULL));
+ qbus_create_inplace(&bus->qbus, &usb_bus_info, host, NULL);
bus->busnr = next_usb_bus++;
QTAILQ_INIT(&bus->free);
QTAILQ_INIT(&bus->used);
QTAILQ_INSERT_TAIL(&busses, bus, next);
- return bus;
}
USBBus *usb_bus_find(int busnr)