OSDN Git Service

usb-ehci: fix ehci_child_detach
authorGerd Hoffmann <kraxel@redhat.com>
Fri, 23 Mar 2012 14:43:45 +0000 (15:43 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 17 Apr 2012 08:23:28 +0000 (10:23 +0200)
Looks like a cut+paste bug from ehci_detach.  When the device itself is
detached from a ehci port (ehci_detach op) we have to clear the
device pointer for the companion port too.  When a device gets removed
from a downstream port of a usb hub (ehci_child_detach op) the ehci port
where the usb hub is plugged in is not affected.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-ehci.c

index 60f9f5b..34f7538 100644 (file)
@@ -797,7 +797,6 @@ static void ehci_child_detach(USBPort *port, USBDevice *child)
     if (portsc & PORTSC_POWNER) {
         USBPort *companion = s->companion_ports[port->index];
         companion->ops->child_detach(companion, child);
-        companion->dev = NULL;
         return;
     }