Commit 72f595f3 authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Greg Kroah-Hartman

usb: renesas_usbhs: fix signed-unsigned return

The return type of usbhsp_setup_pipecfg() was u16 but it was returning
a negative value (-EINVAL). Lets have an additional argument which will
have pipecfg and just return the status (success or error) as the return
from the function.
Signed-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6fb650d4
...@@ -391,9 +391,8 @@ void usbhs_pipe_set_trans_count_if_bulk(struct usbhs_pipe *pipe, int len) ...@@ -391,9 +391,8 @@ void usbhs_pipe_set_trans_count_if_bulk(struct usbhs_pipe *pipe, int len)
/* /*
* pipe setup * pipe setup
*/ */
static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, static int usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, int is_host,
int is_host, int dir_in, u16 *pipecfg)
int dir_in)
{ {
u16 type = 0; u16 type = 0;
u16 bfre = 0; u16 bfre = 0;
...@@ -451,14 +450,14 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, ...@@ -451,14 +450,14 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
/* EPNUM */ /* EPNUM */
epnum = 0; /* see usbhs_pipe_config_update() */ epnum = 0; /* see usbhs_pipe_config_update() */
*pipecfg = type |
return type | bfre |
bfre | dblb |
dblb | cntmd |
cntmd | dir |
dir | shtnak |
shtnak | epnum;
epnum; return 0;
} }
static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe) static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe)
...@@ -703,7 +702,11 @@ struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv, ...@@ -703,7 +702,11 @@ struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv,
return NULL; return NULL;
} }
pipecfg = usbhsp_setup_pipecfg(pipe, is_host, dir_in); if (usbhsp_setup_pipecfg(pipe, is_host, dir_in, &pipecfg)) {
dev_err(dev, "can't setup pipe\n");
return NULL;
}
pipebuf = usbhsp_setup_pipebuff(pipe); pipebuf = usbhsp_setup_pipebuff(pipe);
usbhsp_pipe_select(pipe); usbhsp_pipe_select(pipe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment