aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/chrome/cros_ec_ishtp.c
diff options
context:
space:
mode:
authorTzung-Bi Shih <tzungbi@kernel.org>2022-05-13 12:41:38 +0800
committerTzung-Bi Shih <tzungbi@kernel.org>2022-05-16 10:01:51 +0800
commit71d3ae7fb6404c87b498f8b7f86b8271dd74989f (patch)
tree269112af14e973dfa6a424fd8a4bbd02e2b20d81 /drivers/platform/chrome/cros_ec_ishtp.c
parentplatform/chrome: cros_ec_proto: drop unneeded BUG_ON() in prepare_packet() (diff)
downloadlinux-dev-71d3ae7fb6404c87b498f8b7f86b8271dd74989f.tar.xz
linux-dev-71d3ae7fb6404c87b498f8b7f86b8271dd74989f.zip
platform/chrome: correct cros_ec_prepare_tx() usage
cros_ec_prepare_tx() returns either: - >= 0 for number of prepared bytes. - < 0 for -errno. Correct the comment and make sure all callers check the return code. Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20220513044143.1045728-3-tzungbi@kernel.org
Diffstat (limited to 'drivers/platform/chrome/cros_ec_ishtp.c')
-rw-r--r--drivers/platform/chrome/cros_ec_ishtp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/chrome/cros_ec_ishtp.c b/drivers/platform/chrome/cros_ec_ishtp.c
index 4020b8354bae..cb2031cf7106 100644
--- a/drivers/platform/chrome/cros_ec_ishtp.c
+++ b/drivers/platform/chrome/cros_ec_ishtp.c
@@ -521,7 +521,9 @@ static int cros_ec_pkt_xfer_ish(struct cros_ec_device *ec_dev,
out_msg->hdr.status = 0;
ec_dev->dout += OUT_MSG_EC_REQUEST_PREAMBLE;
- cros_ec_prepare_tx(ec_dev, msg);
+ rv = cros_ec_prepare_tx(ec_dev, msg);
+ if (rv < 0)
+ goto end_error;
ec_dev->dout -= OUT_MSG_EC_REQUEST_PREAMBLE;
dev_dbg(dev,