diff options
Diffstat (limited to 'drivers/usb/renesas_usbhs/fifo.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/fifo.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c index 9bf3a437ea0b..8b40726ba966 100644 --- a/drivers/usb/renesas_usbhs/fifo.c +++ b/drivers/usb/renesas_usbhs/fifo.c | |||
@@ -54,6 +54,8 @@ 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 | void (*done)(struct usbhs_priv *priv, | ||
58 | struct usbhs_pkt *pkt), | ||
57 | void *buf, int len, int zero) | 59 | void *buf, int len, int zero) |
58 | { | 60 | { |
59 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | 61 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
@@ -63,6 +65,11 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, | |||
63 | /******************** spin lock ********************/ | 65 | /******************** spin lock ********************/ |
64 | usbhs_lock(priv, flags); | 66 | usbhs_lock(priv, flags); |
65 | 67 | ||
68 | if (!done) { | ||
69 | dev_err(dev, "no done function\n"); | ||
70 | return; | ||
71 | } | ||
72 | |||
66 | if (!pipe->handler) { | 73 | if (!pipe->handler) { |
67 | dev_err(dev, "no handler function\n"); | 74 | dev_err(dev, "no handler function\n"); |
68 | pipe->handler = &usbhsf_null_handler; | 75 | pipe->handler = &usbhsf_null_handler; |
@@ -82,6 +89,7 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt, | |||
82 | pkt->length = len; | 89 | pkt->length = len; |
83 | pkt->zero = zero; | 90 | pkt->zero = zero; |
84 | pkt->actual = 0; | 91 | pkt->actual = 0; |
92 | pkt->done = done; | ||
85 | 93 | ||
86 | usbhs_unlock(priv, flags); | 94 | usbhs_unlock(priv, flags); |
87 | /******************** spin unlock ******************/ | 95 | /******************** spin unlock ******************/ |
@@ -131,7 +139,6 @@ enum { | |||
131 | static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type) | 139 | static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type) |
132 | { | 140 | { |
133 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); | 141 | struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
134 | struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv); | ||
135 | struct usbhs_pkt *pkt; | 142 | struct usbhs_pkt *pkt; |
136 | struct device *dev = usbhs_priv_to_dev(priv); | 143 | struct device *dev = usbhs_priv_to_dev(priv); |
137 | int (*func)(struct usbhs_pkt *pkt, int *is_done); | 144 | int (*func)(struct usbhs_pkt *pkt, int *is_done); |
@@ -171,7 +178,7 @@ __usbhs_pkt_handler_end: | |||
171 | /******************** spin unlock ******************/ | 178 | /******************** spin unlock ******************/ |
172 | 179 | ||
173 | if (is_done) { | 180 | if (is_done) { |
174 | info->done(priv, pkt); | 181 | pkt->done(priv, pkt); |
175 | usbhs_pkt_start(pipe); | 182 | usbhs_pkt_start(pipe); |
176 | } | 183 | } |
177 | 184 | ||