Skip to content

Commit

Permalink
usb: renesas_usbhs: show error reason on usbhsh_urb_enqueu()
Browse files Browse the repository at this point in the history
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Dec 13, 2011
1 parent 2d833fa commit 15a3838
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -949,12 +949,15 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,

if (!usbhsh_is_running(hpriv)) {
ret = -EIO;
dev_err(dev, "host is not running\n");
goto usbhsh_urb_enqueue_error_not_linked;
}

ret = usb_hcd_link_urb_to_ep(hcd, urb);
if (ret)
if (ret) {
dev_err(dev, "urb link failed\n");
goto usbhsh_urb_enqueue_error_not_linked;
}

/*
* attach udev if needed
Expand All @@ -964,6 +967,7 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
new_udev = usbhsh_device_attach(hpriv, urb);
if (!new_udev) {
ret = -EIO;
dev_err(dev, "device attach failed\n");
goto usbhsh_urb_enqueue_error_not_linked;
}
}
Expand All @@ -974,8 +978,10 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
*/
if (!usbhsh_ep_to_uep(ep)) {
ret = usbhsh_endpoint_attach(hpriv, urb, mem_flags);
if (ret < 0)
if (ret < 0) {
dev_err(dev, "endpoint attach failed\n");
goto usbhsh_urb_enqueue_error_free_device;
}
}

/*
Expand All @@ -989,8 +995,10 @@ static int usbhsh_urb_enqueue(struct usb_hcd *hcd,
else
break;
}
if (ret < 0)
if (ret < 0) {
dev_err(dev, "pipe attach failed\n");
goto usbhsh_urb_enqueue_error_free_endpoint;
}

/*
* push packet
Expand Down

0 comments on commit 15a3838

Please sign in to comment.