summaryrefslogtreecommitdiffstats
path: root/drivers/greybus
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2021-01-18 15:46:29 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-01-26 19:20:11 +0100
commite4240253ac853886e7066e0bb765e2d96e3b1eb6 (patch)
treefc4d045434444efa09126717a9152ee144d411d6 /drivers/greybus
parent7eecea89e44f64e60f1410483e79a0cab18ad580 (diff)
downloadlinux-e4240253ac853886e7066e0bb765e2d96e3b1eb6.tar.bz2
greybus: es2: drop short control-transfer checks
There's no need to check for short USB control transfers when sending data using so remove the redundant sanity checks. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20210118144629.25533-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/greybus')
-rw-r--r--drivers/greybus/es2.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/greybus/es2.c b/drivers/greybus/es2.c
index 1df6ab5d339d..48ad154df3a7 100644
--- a/drivers/greybus/es2.c
+++ b/drivers/greybus/es2.c
@@ -567,12 +567,9 @@ static int cport_enable(struct gb_host_device *hd, u16 cport_id,
USB_DIR_OUT | USB_TYPE_VENDOR |
USB_RECIP_INTERFACE, cport_id, 0,
req, sizeof(*req), ES2_USB_CTRL_TIMEOUT);
- if (ret != sizeof(*req)) {
+ if (ret < 0) {
dev_err(&udev->dev, "failed to set cport flags for port %d\n",
cport_id);
- if (ret >= 0)
- ret = -EIO;
-
goto out;
}
@@ -961,12 +958,10 @@ static int arpc_send(struct es2_ap_dev *es2, struct arpc *rpc, int timeout)
0, 0,
rpc->req, le16_to_cpu(rpc->req->size),
ES2_USB_CTRL_TIMEOUT);
- if (retval != le16_to_cpu(rpc->req->size)) {
+ if (retval < 0) {
dev_err(&udev->dev,
"failed to send ARPC request %d: %d\n",
rpc->req->type, retval);
- if (retval > 0)
- retval = -EIO;
return retval;
}