summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-07-13 00:03:36 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-07-13 00:08:20 -0700
commit21184c4efbba7b7959c7868cf2b99f43f29fc199 (patch)
tree9b2689a7a8ecde630ebed0e637d97a0cf461dd66
parentfea2021c76a414b71204cc2aea623bb037fa913b (diff)
downloadlinux-21184c4efbba7b7959c7868cf2b99f43f29fc199.tar.bz2
Input: cy8ctmg110_ts - fix checking return value of i2c_master_send
i2c_master_send returns negative errno, or else the number of bytes written. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/touchscreen/cy8ctmg110_ts.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
index a93c5c26ab3f..b3fdd1361c36 100644
--- a/drivers/input/touchscreen/cy8ctmg110_ts.c
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -84,9 +84,9 @@ static int cy8ctmg110_write_regs(struct cy8ctmg110 *tsc, unsigned char reg,
memcpy(i2c_data + 1, value, len);
ret = i2c_master_send(client, i2c_data, len + 1);
- if (ret != 1) {
+ if (ret != len + 1) {
dev_err(&client->dev, "i2c write data cmd failed\n");
- return ret ? ret : -EIO;
+ return ret < 0 ? ret : -EIO;
}
return 0;