summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-meson.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2017-03-25 14:09:03 +0100
committerWolfram Sang <wsa@the-dreams.de>2017-03-30 17:31:01 +0200
commite4d6bc380c9a3dd955a2c8c6c8856e913b1b42cb (patch)
tree45b544755e4655926e14ce370754348ed45ad4aa /drivers/i2c/busses/i2c-meson.c
parenti2c: meson: use full 12 bits for clock divider (diff)
downloadlinux-e4d6bc380c9a3dd955a2c8c6c8856e913b1b42cb.tar.xz
linux-e4d6bc380c9a3dd955a2c8c6c8856e913b1b42cb.zip
i2c: meson: remove variable count from meson_i2c_xfer
Variable count has always the same value as i, so we don't need it. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-meson.c')
-rw-r--r--drivers/i2c/busses/i2c-meson.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-meson.c b/drivers/i2c/busses/i2c-meson.c
index abaa7cae0936..0a9847c37a63 100644
--- a/drivers/i2c/busses/i2c-meson.c
+++ b/drivers/i2c/busses/i2c-meson.c
@@ -367,7 +367,7 @@ static int meson_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{
struct meson_i2c *i2c = adap->algo_data;
- int i, ret = 0, count = 0;
+ int i, ret = 0;
clk_enable(i2c->clk);
@@ -375,12 +375,11 @@ static int meson_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
ret = meson_i2c_xfer_msg(i2c, msgs + i, i == num - 1);
if (ret)
break;
- count++;
}
clk_disable(i2c->clk);
- return ret ? ret : count;
+ return ret ?: i;
}
static u32 meson_i2c_func(struct i2c_adapter *adap)