Commit a7c25c70 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Luis Henriques

i2c: rk3x: report number of messages transmitted

commit c6cbfb91 upstream.

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: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent edd6f441
...@@ -588,7 +588,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap, ...@@ -588,7 +588,7 @@ static int rk3x_i2c_xfer(struct i2c_adapter *adap,
clk_disable(i2c->clk); clk_disable(i2c->clk);
spin_unlock_irqrestore(&i2c->lock, flags); spin_unlock_irqrestore(&i2c->lock, flags);
return ret; return ret < 0 ? ret : num;
} }
static u32 rk3x_i2c_func(struct i2c_adapter *adap) static u32 rk3x_i2c_func(struct i2c_adapter *adap)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment