Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280865
b: refs/heads/master
c: fc9d5c7
h: refs/heads/master
i:
  280863: 5bc9854
v: v3
  • Loading branch information
Kuninori Morimoto authored and Felipe Balbi committed Dec 12, 2011
1 parent ae95278 commit 0ca2156
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ee8a0bf5a775098b1140195b6bfacb4813166e5f
refs/heads/master: fc9d5c79f681a7bff588d32de9429be360996df7
12 changes: 3 additions & 9 deletions trunk/drivers/usb/renesas_usbhs/mod_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ static struct usbhsh_request *usbhsh_ureq_alloc(struct usbhsh_hpriv *hpriv,
*/
list_add_tail(&ureq->ureq_link, &hpriv->ureq_link_active);
ureq->urb = urb;
usbhsh_urb_to_ureq(urb) = ureq;

return ureq;
}
Expand All @@ -254,6 +255,7 @@ static void usbhsh_ureq_free(struct usbhsh_hpriv *hpriv,
* removed from "active" list,
* and push it to "free" list
*/
usbhsh_urb_to_ureq(ureq->urb) = NULL;
ureq->urb = NULL;
list_del_init(&ureq->ureq_link);
list_add_tail(&ureq->ureq_link, &hpriv->ureq_link_free);
Expand Down Expand Up @@ -495,7 +497,6 @@ static void usbhsh_queue_done(struct usbhs_priv *priv, struct usbhs_pkt *pkt)

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

usb_hcd_unlink_urb_from_ep(hcd, urb);
usb_hcd_giveback_urb(hcd, urb, 0);
Expand Down Expand Up @@ -523,7 +524,6 @@ static int usbhsh_queue_push(struct usb_hcd *hcd,
dev_err(dev, "ureq alloc fail\n");
return -ENOMEM;
}
usbhsh_urb_to_ureq(urb) = ureq;

if (usb_pipein(urb->pipe))
pipe->handler = &usbhs_fifo_pio_pop_handler;
Expand Down Expand Up @@ -606,12 +606,10 @@ static void usbhsh_data_stage_packet_done(struct usbhs_priv *priv,
{
struct usbhsh_request *ureq = usbhsh_pkt_to_ureq(pkt);
struct usbhsh_hpriv *hpriv = usbhsh_priv_to_hpriv(priv);
struct urb *urb = ureq->urb;

/* this ureq was connected to urb when usbhsh_urb_enqueue() */

usbhsh_ureq_free(hpriv, ureq);
usbhsh_urb_to_ureq(urb) = NULL;
}

static int usbhsh_data_stage_packet_push(struct usbhsh_hpriv *hpriv,
Expand All @@ -626,7 +624,6 @@ static int usbhsh_data_stage_packet_push(struct usbhsh_hpriv *hpriv,
ureq = usbhsh_ureq_alloc(hpriv, urb, mem_flags);
if (unlikely(!ureq))
return -ENOMEM;
usbhsh_urb_to_ureq(urb) = ureq;

if (usb_pipein(urb->pipe))
pipe->handler = &usbhs_dcp_data_stage_in_handler;
Expand Down Expand Up @@ -656,7 +653,6 @@ static int usbhsh_status_stage_packet_push(struct usbhsh_hpriv *hpriv,
ureq = usbhsh_ureq_alloc(hpriv, urb, mem_flags);
if (unlikely(!ureq))
return -ENOMEM;
usbhsh_urb_to_ureq(urb) = ureq;

if (usb_pipein(urb->pipe))
pipe->handler = &usbhs_dcp_status_stage_in_handler;
Expand Down Expand Up @@ -811,10 +807,8 @@ static int usbhsh_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status)
struct usbhsh_hpriv *hpriv = usbhsh_hcd_to_hpriv(hcd);
struct usbhsh_request *ureq = usbhsh_urb_to_ureq(urb);

if (ureq) {
if (ureq)
usbhsh_ureq_free(hpriv, ureq);
usbhsh_urb_to_ureq(urb) = NULL;
}

return 0;
}
Expand Down

0 comments on commit 0ca2156

Please sign in to comment.