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>
This commit is contained in:
Colin Cross
2010-12-29 21:15:12 -08:00
parent 0429f17bd8
commit 619ec9a64f

View File

@@ -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)