aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/renesas_usbhs/fifo.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-10-10 22:04:41 -0700
committerFelipe Balbi <balbi@ti.com>2011-10-13 20:41:44 +0300
commitb331872b85c2ab388129af3343474e02e89498af (patch)
tree2337bac307e1dc6998bb010b00a4fcc7b0015fd2 /drivers/usb/renesas_usbhs/fifo.c
parent3cf8ed1284799406c506029207004e97d5b2c738 (diff)
downloadkernel_samsung_smdk4412-b331872b85c2ab388129af3343474e02e89498af.zip
kernel_samsung_smdk4412-b331872b85c2ab388129af3343474e02e89498af.tar.gz
kernel_samsung_smdk4412-b331872b85c2ab388129af3343474e02e89498af.tar.bz2
usb: gadget: renesas_usbhs: move done callback to struct usbhs_pkt
transfer done function was registered in struct struct usbhs_pipe_info. It was good for mod_gadget, but not good for mod_host. This function move it to struct usbhs_pkt. 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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index 9bf3a43..8b40726 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 = {
};
void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
+ void (*done)(struct usbhs_priv *priv,
+ struct usbhs_pkt *pkt),
void *buf, int len, int zero)
{
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,
/******************** spin lock ********************/
usbhs_lock(priv, flags);
+ if (!done) {
+ dev_err(dev, "no done function\n");
+ return;
+ }
+
if (!pipe->handler) {
dev_err(dev, "no handler function\n");
pipe->handler = &usbhsf_null_handler;
@@ -82,6 +89,7 @@ void usbhs_pkt_push(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt,
pkt->length = len;
pkt->zero = zero;
pkt->actual = 0;
+ pkt->done = done;
usbhs_unlock(priv, flags);
/******************** spin unlock ******************/
@@ -131,7 +139,6 @@ enum {
static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int type)
{
struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe);
- struct usbhs_pipe_info *info = usbhs_priv_to_pipeinfo(priv);
struct usbhs_pkt *pkt;
struct device *dev = usbhs_priv_to_dev(priv);
int (*func)(struct usbhs_pkt *pkt, int *is_done);
@@ -171,7 +178,7 @@ __usbhs_pkt_handler_end:
/******************** spin unlock ******************/
if (is_done) {
- info->done(priv, pkt);
+ pkt->done(priv, pkt);
usbhs_pkt_start(pipe);
}