summaryrefslogtreecommitdiff
path: root/hw/usb-musb.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2012-01-10 17:59:33 +0100
committerGerd Hoffmann <kraxel@redhat.com>2012-02-10 11:31:57 +0100
commit87e043f17e9b3781b3c29c02ff32abc23ac15708 (patch)
tree376293a03fb49d941979bed414ae8950919f457d /hw/usb-musb.c
parent993048bb6bf6b74bbf6b7dae8e7c2db523cfcecf (diff)
downloadqemu-87e043f17e9b3781b3c29c02ff32abc23ac15708.zip
usb-musb: switch to usb_find_device()
Switch over musb to use the new usb_find_device() function for device lookup. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb-musb.c')
-rw-r--r--hw/usb-musb.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/hw/usb-musb.c b/hw/usb-musb.c
index c2753c984c..ecac631228 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;