diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2016-04-30 14:29:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-03 17:32:07 -0400 |
commit | 72f595f3b5cef2c36beb1d07409de58d9e503428 (patch) | |
tree | 72b94e41e4804ab53eca570f79f8b560c42654e8 | |
parent | 6fb650d43da3e7054984dc548eaa88765a94d49f (diff) |
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: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/renesas_usbhs/pipe.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/usb/renesas_usbhs/pipe.c b/drivers/usb/renesas_usbhs/pipe.c index 77b615ce4a25..c238772b9e9e 100644 --- a/drivers/usb/renesas_usbhs/pipe.c +++ b/drivers/usb/renesas_usbhs/pipe.c | |||
@@ -391,9 +391,8 @@ void usbhs_pipe_set_trans_count_if_bulk(struct usbhs_pipe *pipe, int len) | |||
391 | /* | 391 | /* |
392 | * pipe setup | 392 | * pipe setup |
393 | */ | 393 | */ |
394 | static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, | 394 | static int usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, int is_host, |
395 | int is_host, | 395 | int dir_in, u16 *pipecfg) |
396 | int dir_in) | ||
397 | { | 396 | { |
398 | u16 type = 0; | 397 | u16 type = 0; |
399 | u16 bfre = 0; | 398 | u16 bfre = 0; |
@@ -451,14 +450,14 @@ static u16 usbhsp_setup_pipecfg(struct usbhs_pipe *pipe, | |||
451 | 450 | ||
452 | /* EPNUM */ | 451 | /* EPNUM */ |
453 | epnum = 0; /* see usbhs_pipe_config_update() */ | 452 | epnum = 0; /* see usbhs_pipe_config_update() */ |
454 | 453 | *pipecfg = type | | |
455 | return type | | 454 | bfre | |
456 | bfre | | 455 | dblb | |
457 | dblb | | 456 | cntmd | |
458 | cntmd | | 457 | dir | |
459 | dir | | 458 | shtnak | |
460 | shtnak | | 459 | epnum; |
461 | epnum; | 460 | return 0; |
462 | } | 461 | } |
463 | 462 | ||
464 | static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe) | 463 | static u16 usbhsp_setup_pipebuff(struct usbhs_pipe *pipe) |
@@ -703,7 +702,11 @@ struct usbhs_pipe *usbhs_pipe_malloc(struct usbhs_priv *priv, | |||
703 | return NULL; | 702 | return NULL; |
704 | } | 703 | } |
705 | 704 | ||
706 | pipecfg = usbhsp_setup_pipecfg(pipe, is_host, dir_in); | 705 | if (usbhsp_setup_pipecfg(pipe, is_host, dir_in, &pipecfg)) { |
706 | dev_err(dev, "can't setup pipe\n"); | ||
707 | return NULL; | ||
708 | } | ||
709 | |||
707 | pipebuf = usbhsp_setup_pipebuff(pipe); | 710 | pipebuf = usbhsp_setup_pipebuff(pipe); |
708 | 711 | ||
709 | usbhsp_pipe_select(pipe); | 712 | usbhsp_pipe_select(pipe); |