Commit 6973a39c authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Wolfram Sang

i2c: tegra: match return type of wait_for_completion_timeout

return type of wait_for_completion_timeout is unsigned long not int. As ret
was only used for wait_for_completion_timeout here it is renamed to time_left
the type changed to unsigned long and references fixed up.
Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 271a89cd
...@@ -532,7 +532,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, ...@@ -532,7 +532,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
{ {
u32 packet_header; u32 packet_header;
u32 int_mask; u32 int_mask;
int ret; unsigned long time_left;
tegra_i2c_flush_fifos(i2c_dev); tegra_i2c_flush_fifos(i2c_dev);
...@@ -585,18 +585,20 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, ...@@ -585,18 +585,20 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
dev_dbg(i2c_dev->dev, "unmasked irq: %02x\n", dev_dbg(i2c_dev->dev, "unmasked irq: %02x\n",
i2c_readl(i2c_dev, I2C_INT_MASK)); i2c_readl(i2c_dev, I2C_INT_MASK));
ret = wait_for_completion_timeout(&i2c_dev->msg_complete, TEGRA_I2C_TIMEOUT); time_left = wait_for_completion_timeout(&i2c_dev->msg_complete,
TEGRA_I2C_TIMEOUT);
tegra_i2c_mask_irq(i2c_dev, int_mask); tegra_i2c_mask_irq(i2c_dev, int_mask);
if (ret == 0) { if (time_left == 0) {
dev_err(i2c_dev->dev, "i2c transfer timed out\n"); dev_err(i2c_dev->dev, "i2c transfer timed out\n");
tegra_i2c_init(i2c_dev); tegra_i2c_init(i2c_dev);
return -ETIMEDOUT; return -ETIMEDOUT;
} }
dev_dbg(i2c_dev->dev, "transfer complete: %d %d %d\n", dev_dbg(i2c_dev->dev, "transfer complete: %lu %d %d\n",
ret, completion_done(&i2c_dev->msg_complete), i2c_dev->msg_err); time_left, completion_done(&i2c_dev->msg_complete),
i2c_dev->msg_err);
if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) if (likely(i2c_dev->msg_err == I2C_ERR_NONE))
return 0; return 0;
......
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