summaryrefslogtreecommitdiff
path: root/drivers/usb/renesas_usbhs/pipe.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2011-04-21 09:09:58 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-04-30 04:24:31 +0400
commit45e13e6e0aa954af2d4779a07262f4c12d6f032f (patch)
tree31067107be638d85102ac5347d69e029473802fe /drivers/usb/renesas_usbhs/pipe.c
parenta0c25c20502e0c4a467f5d7e27b2a599cfe57abe (diff)
downloadlinux-45e13e6e0aa954af2d4779a07262f4c12d6f032f.tar.xz
usb: renesas_usbhs: modify fifo clear timing
Pipe buffer should be cleaned before using it, but should NOT be cleaned in pipe "prepare" function. Because the pipe might be working in such timing. This patch fixup this issue. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/renesas_usbhs/pipe.c')
-rw-r--r--drivers/usb/renesas_usbhs/pipe.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c
index b7a9137f599b..4852c073e2f5 100644
--- a/drivers/usb/renesas_usbhs/pipe.c
+++ b/drivers/usb/renesas_usbhs/pipe.c
@@ -369,15 +369,7 @@ static int usbhsp_fifo_select(struct usbhs_pipe *pipe, int write)
int usbhs_fifo_prepare_write(struct usbhs_pipe *pipe)
{
- int ret;
-
- ret = usbhsp_fifo_select(pipe, 1);
- if (ret < 0)
- return ret;
-
- usbhsp_fifo_clear(pipe);
-
- return ret;
+ return usbhsp_fifo_select(pipe, 1);
}
int usbhs_fifo_write(struct usbhs_pipe *pipe, u8 *buf, int len)
@@ -392,7 +384,7 @@ int usbhs_fifo_write(struct usbhs_pipe *pipe, u8 *buf, int len)
if (ret < 0)
return ret;
- ret = usbhs_fifo_prepare_write(pipe);
+ ret = usbhsp_fifo_select(pipe, 1);
if (ret < 0)
return ret;
@@ -750,6 +742,8 @@ void usbhs_pipe_init(struct usbhs_priv *priv)
usbhsp_flags_init(pipe);
pipe->mod_private = NULL;
+
+ usbhsp_fifo_clear(pipe);
}
}