Skip to content

Commit

Permalink
usb: renesas_usbhs: care usb_hcd_giveback_urb() status
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Dec 13, 2011
1 parent b1930da commit 6d0376f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,7 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
struct urb *urb = ureq->urb;
struct usbhsh_ep *uep = usbhsh_ep_to_uep(urb->ep);
struct device *dev = usbhs_priv_to_dev(priv);
int status = 0;

dev_dbg(dev, "%s\n", __func__);

Expand All @@ -643,14 +644,17 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)
return;
}

if (!usbhsh_is_running(hpriv))
status = -ESHUTDOWN;

urb->actual_length = pkt->actual;
usbhsh_ureq_free(hpriv, ureq);

usbhsh_endpoint_sequence_save(hpriv, urb, pkt);
usbhsh_pipe_detach(hpriv, uep);

usb_hcd_unlink_urb_from_ep(hcd, urb);
usb_hcd_giveback_urb(hcd, urb, 0);
usb_hcd_giveback_urb(hcd, urb, status);
}

static int usbhsh_queue_push(struct usb_hcd *hcd,
Expand Down

0 comments on commit 6d0376f

Please sign in to comment.