From 71d3ae7fb6404c87b498f8b7f86b8271dd74989f Mon Sep 17 00:00:00 2001 From: Tzung-Bi Shih Date: Fri, 13 May 2022 12:41:38 +0800 Subject: 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 Signed-off-by: Tzung-Bi Shih Link: https://lore.kernel.org/r/20220513044143.1045728-3-tzungbi@kernel.org --- drivers/platform/chrome/cros_ec_i2c.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/platform/chrome/cros_ec_i2c.c') diff --git a/drivers/platform/chrome/cros_ec_i2c.c b/drivers/platform/chrome/cros_ec_i2c.c index 22feb0fd4ce7..a4f305f1eb0e 100644 --- a/drivers/platform/chrome/cros_ec_i2c.c +++ b/drivers/platform/chrome/cros_ec_i2c.c @@ -89,6 +89,8 @@ static int cros_ec_pkt_xfer_i2c(struct cros_ec_device *ec_dev, ec_dev->dout++; ret = cros_ec_prepare_tx(ec_dev, msg); + if (ret < 0) + goto done; ec_dev->dout--; /* send command to EC and read answer */ -- cgit v1.2.3