]> git.proxmox.com Git - qemu.git/commitdiff
usb: Add a usb_fill_port helper function
authorHans de Goede <hdegoede@redhat.com>
Thu, 30 Jun 2011 09:57:57 +0000 (11:57 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 5 Jul 2011 13:09:01 +0000 (15:09 +0200)
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-bus.c

index 2abce12de5b0ece6d78d46b0c2b6451b3680283c..776974e6cfea15b7f47f57b00d07dc55a8775dde 100644 (file)
@@ -140,8 +140,8 @@ USBDevice *usb_create_simple(USBBus *bus, const char *name)
     return dev;
 }
 
-void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
-                       USBPortOps *ops, int speedmask)
+static void usb_fill_port(USBPort *port, void *opaque, int index,
+                          USBPortOps *ops, int speedmask)
 {
     port->opaque = opaque;
     port->index = index;
@@ -149,6 +149,12 @@ void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
     port->index = index;
     port->ops = ops;
     port->speedmask = speedmask;
+}
+
+void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
+                       USBPortOps *ops, int speedmask)
+{
+    usb_fill_port(port, opaque, index, ops, speedmask);
     QTAILQ_INSERT_TAIL(&bus->free, port, next);
     bus->nfree++;
 }