diff options
author | Colin Cross <ccross@android.com> | 2010-12-29 21:15:12 -0800 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2011-01-04 14:55:39 -0800 |
commit | 619ec9a64fc0d4e99109f12bd8f30cf0761f1d5d (patch) | |
tree | 9390baa6b28dd1bba11966a143945989e74a8b5d /drivers/i2c/busses | |
parent | 0429f17bd8c8d2610cdb21472239805adc074338 (diff) |
i2c: i2c-tegra: Return error code on partial master_xfer transfer
It is unclear what the correct return value is when
master_xfer gets an error part way through a set of
messages, but other drivers seem to return the error
code of the individual failed message instead of
the number of successful messages. Convert the Tegra
i2c driver to do the same.
Change-Id: Iacda4b6d7591bfe644b93564b93356a0cda3134f
Signed-off-by: Colin Cross <ccross@android.com>
Diffstat (limited to 'drivers/i2c/busses')
-rwxr-xr-x | drivers/i2c/busses/i2c-tegra.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index b7481f496ec3..91aa11ce0de2 100755 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -512,13 +512,16 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int stop = (i == (num - 1)) ? 1 : 0; ret = tegra_i2c_xfer_msg(i2c_bus, &msgs[i], stop); if (ret) - break; + goto out; } + ret = i; + +out: clk_disable(i2c_dev->clk); rt_mutex_unlock(&i2c_dev->dev_lock); - return i; + return ret; } static u32 tegra_i2c_func(struct i2c_adapter *adap) |