From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvotF-00064Y-1M for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvot8-0000Ir-7d for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvot7-0000IK-Sz for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:38 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1ABhb2x000682 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 06:43:37 -0500 From: Gerd Hoffmann Date: Fri, 10 Feb 2012 12:43:09 +0100 Message-Id: <1328874204-20920-14-git-send-email-kraxel@redhat.com> In-Reply-To: <1328874204-20920-1-git-send-email-kraxel@redhat.com> References: <1328874204-20920-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 13/28] usb-musb: switch to usb_find_device() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Switch over musb to use the new usb_find_device() function for device lookup. Signed-off-by: Gerd Hoffmann --- hw/usb-musb.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hw/usb-musb.c b/hw/usb-musb.c index c2753c9..ecac631 100644 --- a/hw/usb-musb.c +++ b/hw/usb-musb.c @@ -605,6 +605,7 @@ static int musb_timeout(int ttype, int speed, int val) static void musb_packet(MUSBState *s, MUSBEndPoint *ep, int epnum, int pid, int len, USBCallback cb, int dir) { + USBDevice *dev; int ret; int idx = epnum && dir; int ttype; @@ -628,10 +629,8 @@ static void musb_packet(MUSBState *s, MUSBEndPoint *ep, ep->packey[dir].ep = ep; ep->packey[dir].dir = dir; - if (s->port.dev) - ret = usb_handle_packet(s->port.dev, &ep->packey[dir].p); - else - ret = USB_RET_NODEV; + dev = usb_find_device(&s->port, ep->packey[dir].p.devaddr); + ret = usb_handle_packet(dev, &ep->packey[dir].p); if (ret == USB_RET_ASYNC) { ep->status[dir] = len; -- 1.7.1