diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2011-10-11 01:00:59 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2011-10-13 13:41:36 -0400 |
commit | 0c6ef985ced753b60ecdc091fa49c3f5fa4a4f79 (patch) | |
tree | dac1c56511cb1e9455eec22320114d69d8df3c33 /drivers/usb/renesas_usbhs/fifo.c | |
parent | 7fd097e727466cda1b22beca6cb11096b8be88d2 (diff) |
usb: gadget: renesas_usbhs: struct usbhs_pipe hold handler
packet handler had moved to struct usbhs_pipe from struct usbhsg_uep.
it is preparation of mod_host support
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/fifo.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 7eacacda858..328238c373f 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -54,7 +54,6 @@ static struct usbhs_pkt_handle usbhsf_null_handler = { | |||
54 | }; | 54 | }; |
55 | 55 | ||
56 | void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, | 56 | void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, |
57 | struct usbhs_pkt_handle *handler, | ||
58 | void *buf, int len, int zero) | 57 | void *buf, int len, int zero) |
59 | { | 58 | { |
60 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | 59 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
@@ -64,17 +63,22 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, | |||
64 | /******************** spin lock ********************/ | 63 | /******************** spin lock ********************/ |
65 | usbhs_lock(priv, flags); | 64 | usbhs_lock(priv, flags); |
66 | 65 | ||
67 | if (!handler) { | 66 | if (!pipe->handler) { |
68 | dev_err(dev, "no handler function\n"); | 67 | dev_err(dev, "no handler function\n"); |
69 | handler = &usbhsf_null_handler; | 68 | pipe->handler = &usbhsf_null_handler; |
70 | } | 69 | } |
71 | 70 | ||
72 | list_del_init(&pkt->node); | 71 | list_del_init(&pkt->node); |
73 | list_add_tail(&pkt->node, &pipe->list); | 72 | list_add_tail(&pkt->node, &pipe->list); |
74 | 73 | ||
74 | /* | ||
75 | * each pkt must hold own handler. | ||
76 | * because handler might be changed by its situation. | ||
77 | * dma handler -> pio handler. | ||
78 | */ | ||
75 | pkt->pipe = pipe; | 79 | pkt->pipe = pipe; |
76 | pkt->buf = buf; | 80 | pkt->buf = buf; |
77 | pkt->handler = handler; | 81 | pkt->handler = pipe->handler; |
78 | pkt->length = len; | 82 | pkt->length = len; |
79 | pkt->zero = zero; | 83 | pkt->zero = zero; |
80 | pkt->actual = 0; | 84 | pkt->actual = 0; |