diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-04-20 15:14:47 -0700 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2015-05-17 19:12:23 -0400 |
commit | 74cd034768fecc289b1ef569f446ff1a54b5081b (patch) | |
tree | 3a29f60da292d4d5ebd738d53c93c3ce738abcfb /drivers/i2c | |
parent | c130887c1434d68ce26c4c3cbdaa82c6b5af06d9 (diff) | |
download | lwn-74cd034768fecc289b1ef569f446ff1a54b5081b.tar.gz lwn-74cd034768fecc289b1ef569f446ff1a54b5081b.zip |
i2c: rk3x: report number of messages transmitted
[ Upstream commit c6cbfb91b878224e78408a2e15901c79de77115a ]
master_xfer() method should return number of i2c messages transferred,
but on Rockchip we were usually returning just 1, which caused trouble
with users that actually check number of transferred messages vs.
checking for negative error codes.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-rk3x.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index f486d0eac4d0..3ba933396c25 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -588,7 +588,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap, clk_disable(i2c->clk); spin_unlock_irqrestore(&i2c->lock, flags); - return ret; + return ret < 0 ? ret : num; } static u32 rk3x_i2c_func(struct i2c_adapter *adap) |