diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-12-01 11:08:44 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2011-01-11 17:01:02 +0100 |
commit | 0d86d2bebb625a222f70b76972139f6a272e3e0b (patch) | |
tree | 2f8763d0041b82f41ef9b14ab6e5529a3c4b6e71 /hw/usb-hub.c | |
parent | ed5a83ddd8c1d8ec7b1015315530cf29949e7c48 (diff) |
usb: create USBPortOps, move attach there.
Create USBPortOps struct, move the attach function to that struct.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-hub.c')
-rw-r--r-- | hw/usb-hub.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/usb-hub.c b/hw/usb-hub.c index 3c7c3eee43..b3d72987f3 100644 --- a/hw/usb-hub.c +++ b/hw/usb-hub.c @@ -506,6 +506,10 @@ static void usb_hub_handle_destroy(USBDevice *dev) } } +static USBPortOps usb_hub_port_ops = { + .attach = usb_hub_attach, +}; + static int usb_hub_initfn(USBDevice *dev) { USBHubState *s = DO_UPCAST(USBHubState, dev, dev); @@ -516,7 +520,7 @@ static int usb_hub_initfn(USBDevice *dev) for (i = 0; i < NUM_PORTS; i++) { port = &s->ports[i]; usb_register_port(usb_bus_from_device(dev), - &port->port, s, i, &s->dev, usb_hub_attach); + &port->port, s, i, &s->dev, &usb_hub_port_ops); port->wPortStatus = PORT_STAT_POWER; port->wPortChange = 0; } |