From: Dmitry Torokhov Date: Mon, 20 Apr 2015 22:14:47 +0000 (-0700) Subject: i2c: rk3x: report number of messages transmitted X-Git-Tag: firefly_0821_release~176^2~1850^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=c6cbfb91b878224e78408a2e15901c79de77115a;p=firefly-linux-kernel-4.4.55.git i2c: rk3x: report number of messages transmitted 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 Signed-off-by: Wolfram Sang Cc: stable@kernel.org --- diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c index 5f96b1b3e3a5..019d5426fe52 100644 --- a/drivers/i2c/busses/i2c-rk3x.c +++ b/drivers/i2c/busses/i2c-rk3x.c @@ -833,7 +833,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)