From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpLIp-0007Sk-7x for qemu-devel@nongnu.org; Mon, 23 Jan 2012 09:55:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpLIn-0004SK-Mi for qemu-devel@nongnu.org; Mon, 23 Jan 2012 09:55:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:13104) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpLIn-0004SG-Es for qemu-devel@nongnu.org; Mon, 23 Jan 2012 09:55:21 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0NEtKXP025259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Jan 2012 09:55:20 -0500 From: Gerd Hoffmann Date: Mon, 23 Jan 2012 15:54:56 +0100 Message-Id: <1327330511-16307-11-git-send-email-kraxel@redhat.com> In-Reply-To: <1327330511-16307-1-git-send-email-kraxel@redhat.com> References: <1327330511-16307-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 10/25] 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