]> git.proxmox.com Git - qemu.git/commitdiff
usb: Move (initial) call of usb_port_location to usb_fill_port
authorHans de Goede <hdegoede@redhat.com>
Thu, 30 Jun 2011 10:05:19 +0000 (12:05 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 5 Jul 2011 13:09:02 +0000 (15:09 +0200)
Cleanup / preparation patch for companion controller support. Note that
as a "side-effect" this patch also fixes the milkymist-softusb controller
not having a port_location set for its ports.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb-bus.c
hw/usb-ehci.c
hw/usb-musb.c
hw/usb-ohci.c
hw/usb-uhci.c

index 776974e6cfea15b7f47f57b00d07dc55a8775dde..e37e8a28a6616a6af9d44280cbc76f2571c38d1e 100644 (file)
@@ -149,6 +149,7 @@ static void usb_fill_port(USBPort *port, void *opaque, int index,
     port->index = index;
     port->ops = ops;
     port->speedmask = speedmask;
+    usb_port_location(port, NULL, index + 1);
 }
 
 void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
index 91fb7dea938bab1fb8481a28ca527960da1a9e68..88cb2c249bb96d60bc692445bc86d0760fbb39d4 100644 (file)
@@ -2206,7 +2206,6 @@ static int usb_ehci_initfn(PCIDevice *dev)
     for(i = 0; i < NB_PORTS; i++) {
         usb_register_port(&s->bus, &s->ports[i], s, i, &ehci_port_ops,
                           USB_SPEED_MASK_HIGH);
-        usb_port_location(&s->ports[i], NULL, i+1);
         s->ports[i].dev = 0;
     }
 
index d15971fcfc90388e6dd2f9d6cd0eab6c3c473d5d..84e601762c9439f5e2f811338fc428be39c58768 100644 (file)
@@ -369,7 +369,6 @@ struct MUSBState *musb_init(qemu_irq *irqs)
     usb_bus_new(&s->bus, &musb_bus_ops, NULL /* FIXME */);
     usb_register_port(&s->bus, &s->port, s, 0, &musb_port_ops,
                       USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
-    usb_port_location(&s->port, NULL, 1);
 
     return s;
 }
index 1c29b9fa6c3f4c973a42aa864b7220434548a747..95e4623d5224cca6afe91eaa6b8194764db51d50 100644 (file)
@@ -1742,7 +1742,6 @@ static void usb_ohci_init(OHCIState *ohci, DeviceState *dev,
     for (i = 0; i < num_ports; i++) {
         usb_register_port(&ohci->bus, &ohci->rhport[i].port, ohci, i, &ohci_port_ops,
                           USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
-        usb_port_location(&ohci->rhport[i].port, NULL, i+1);
     }
 
     ohci->async_td = 0;
index 405fa7b65ee695cbd260dcbfc01602dc65834ac3..fd25d2ae0c3d8ae553a5b72673856edffccd9dc0 100644 (file)
@@ -1129,7 +1129,6 @@ static int usb_uhci_common_initfn(PCIDevice *dev)
     for(i = 0; i < NB_PORTS; i++) {
         usb_register_port(&s->bus, &s->ports[i].port, s, i, &uhci_port_ops,
                           USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL);
-        usb_port_location(&s->ports[i].port, NULL, i+1);
     }
     s->frame_timer = qemu_new_timer_ns(vm_clock, uhci_frame_timer, s);
     s->num_ports_vmstate = NB_PORTS;