Skip to content

Commit

Permalink
usb: renesas_usbhs: fix signed-unsigned return
Browse files Browse the repository at this point in the history
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: Sudip Mukherjee <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and gregkh committed May 3, 2016
1 parent 6fb650d commit 72f595f
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions drivers/usb/renesas_usbhs/pipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,8 @@ void usbhs_pipe_set_trans_count_if_bulk(struct usbhs_pipe *pipe, int len)
/*
* pipe setup
*/
static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,
int is_host,
int dir_in)
static int usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, int is_host,
int dir_in, u16 *pipecfg)
{
u16 type = 0;
u16 bfre = 0;
Expand Down Expand Up @@ -451,14 +450,14 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe,

/* EPNUM */
epnum = 0; /* see usbhs_pipe_config_update() */

return type |
bfre |
dblb |
cntmd |
dir |
shtnak |
epnum;
*pipecfg = type |
bfre |
dblb |
cntmd |
dir |
shtnak |
epnum;
return 0;
}

static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe)
Expand Down Expand Up @@ -703,7 +702,11 @@ struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv,
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);

usbhsp_pipe_select(pipe);
Expand Down

0 comments on commit 72f595f

Please sign in to comment.