Skip to content

Commit

Permalink
i2c: rk3x: report number of messages transmitted
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Dmitry Torokhov authored and Wolfram Sang committed Apr 23, 2015
1 parent 27cf3a1 commit c6cbfb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-rk3x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c6cbfb9

Please sign in to comment.