aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-12-08 21:31:11 -0500
committerFelipe Balbi <balbi@ti.com>2011-12-13 06:06:29 -0500
commit6d0376f84446507d07ae83935cbe7538d07c352f (patch)
tree0d03a9fe8932f1bb5641c943a1f84f83cfa442fd /drivers/usb/renesas_usbhs
parentb1930da08872f6e17b8cdca60ee9c7321a8b5b8c (diff)
usb: renesas_usbhs: care usb_hcd_giveback_urb() status
Without this patch, USB host hub shows error when cable was detached Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs')
-rw-r--r--drivers/usb/renesas_usbhs/mod_host.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/renesas_usbhs/mod_host.c b/drivers/usb/renesas_usbhs/mod_host.c
index 28b2cb3a029a..9715a7013734 100644
--- a/drivers/usb/renesas_usbhs/mod_host.c
+++ b/drivers/usb/renesas_usbhs/mod_host.c
@@ -635,6 +635,7 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
635 struct urb *urb = ureq->urb; 635 struct urb *urb = ureq->urb;
636 struct usbhsh_ep *uep = usbhsh_ep_to_uep(urb->ep); 636 struct usbhsh_ep *uep = usbhsh_ep_to_uep(urb->ep);
637 struct device *dev = usbhs_priv_to_dev(priv); 637 struct device *dev = usbhs_priv_to_dev(priv);
638 int status = 0;
638 639
639 dev_dbg(dev, "%s\n", __func__); 640 dev_dbg(dev, "%s\n", __func__);
640 641
@@ -643,6 +644,9 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
643 return; 644 return;
644 } 645 }
645 646
647 if (!usbhsh_is_running(hpriv))
648 status = -ESHUTDOWN;
649
646 urb->actual_length = pkt->actual; 650 urb->actual_length = pkt->actual;
647 usbhsh_ureq_free(hpriv, ureq); 651 usbhsh_ureq_free(hpriv, ureq);
648 652
@@ -650,7 +654,7 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
650 usbhsh_pipe_detach(hpriv, uep); 654 usbhsh_pipe_detach(hpriv, uep);
651 655
652 usb_hcd_unlink_urb_from_ep(hcd, urb); 656 usb_hcd_unlink_urb_from_ep(hcd, urb);
653 usb_hcd_giveback_urb(hcd, urb, 0); 657 usb_hcd_giveback_urb(hcd, urb, status);
654} 658}
655 659
656static int usbhsh_queue_push(struct usb_hcd *hcd, 660static int usbhsh_queue_push(struct usb_hcd *hcd,