From 4706ab6cc0af86d3f38806664420cc3eb8999bd9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 24 Jun 2011 12:31:11 +0200 Subject: usb: Replace device_destroy bus op with a child_detach port op Note this fixes 2 things in one go, first of all the device_destroy bus op should be a device_detach bus op, as pending async packets from the device should be cancelled on detach not on destroy. Secondly having this as a bus op won't work with companion controllers, since then there will be 1 bus driven by the ehci controller and thus 1 set of bus ops, but the device being detached may be downstream of a handed over port. Making the detach of a downstream device a port op allows the ehci controller to forward this to the companion controller port for handed over ports. Signed-off-by: Hans de Goede Signed-off-by: Gerd Hoffmann --- hw/usb-bus.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'hw/usb-bus.c') diff --git a/hw/usb-bus.c b/hw/usb-bus.c index b511bac411..c8347e9e3b 100644 --- a/hw/usb-bus.c +++ b/hw/usb-bus.c @@ -82,12 +82,10 @@ static int usb_qdev_init(DeviceState *qdev, DeviceInfo *base) static int usb_qdev_exit(DeviceState *qdev) { USBDevice *dev = DO_UPCAST(USBDevice, qdev, qdev); - USBBus *bus = usb_bus_from_device(dev); if (dev->attached) { usb_device_detach(dev); } - bus->ops->device_destroy(bus, dev); if (dev->info->handle_destroy) { dev->info->handle_destroy(dev); } -- cgit v1.2.3