From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42917) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaC6z-0001BO-EI for qemu-devel@nongnu.org; Fri, 24 Jun 2011 15:32:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QaC6x-0002Oy-E2 for qemu-devel@nongnu.org; Fri, 24 Jun 2011 15:32:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57317) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QaC6w-0002OV-SB for qemu-devel@nongnu.org; Fri, 24 Jun 2011 15:32:15 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5OJWDBe031529 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 24 Jun 2011 15:32:13 -0400 From: Hans de Goede Date: Fri, 24 Jun 2011 21:32:53 +0200 Message-Id: <1308943978-6152-7-git-send-email-hdegoede@redhat.com> In-Reply-To: <1308943978-6152-1-git-send-email-hdegoede@redhat.com> References: <1308943978-6152-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 06/11] usb-ehci: cleanup port reset handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Hans de Goede , qemu-devel@nongnu.org Doing a usb_attach when dev is NULL will just result in the port detach op getting called even though nothing was connected in the first place. Signed-off-by: Hans de Goede --- hw/usb-ehci.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/hw/usb-ehci.c b/hw/usb-ehci.c index 0b1cdaf..cfda374 100644 --- a/hw/usb-ehci.c +++ b/hw/usb-ehci.c @@ -863,14 +863,9 @@ static void handle_port_status_write(EHCIState *s, int port, uint32_t val) if (!(val & PORTSC_PRESET) &&(*portsc & PORTSC_PRESET)) { trace_usb_ehci_port_reset(port, 0); - usb_attach(&s->ports[port], dev); - - // TODO how to handle reset of ports with no device if (dev) { + usb_attach(&s->ports[port], dev); usb_send_msg(dev, USB_MSG_RESET); - } - - if (s->ports[port].dev) { *portsc &= ~PORTSC_CSC; } -- 1.7.5.1