usb: create USBPortOps, move attach there.
Create USBPortOps struct, move the attach function to that struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
diff --git a/hw/usb-bus.c b/hw/usb-bus.c
index af537c2..9dc8793 100644
--- a/hw/usb-bus.c
+++ b/hw/usb-bus.c
@@ -113,12 +113,14 @@
}
void usb_register_port(USBBus *bus, USBPort *port, void *opaque, int index,
- USBDevice *pdev, usb_attachfn attach)
+ USBDevice *pdev, USBPortOps *ops)
{
port->opaque = opaque;
port->index = index;
- port->attach = attach;
port->pdev = pdev;
+ port->opaque = opaque;
+ port->index = index;
+ port->ops = ops;
QTAILQ_INSERT_TAIL(&bus->free, port, next);
bus->nfree++;
}