diff options
author | Nicholas Mc Guire <hofrat@osadl.org> | 2015-03-01 09:17:41 -0500 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2015-03-15 05:16:17 -0400 |
commit | 6973a39c9e35f46f2ea79ccbc25d3cab58737331 (patch) | |
tree | f3d8804891257f65bb0550247aa1512d64f125e7 /drivers/i2c | |
parent | 271a89cdd65f8c2b4a6be865859f8d2d1b504696 (diff) |
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: Nicholas Mc Guire <hofrat@osadl.org>
Reviewed-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 29f14331dd9d..1bcd75ea0b4c 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c | |||
@@ -532,7 +532,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, | |||
532 | { | 532 | { |
533 | u32 packet_header; | 533 | u32 packet_header; |
534 | u32 int_mask; | 534 | u32 int_mask; |
535 | int ret; | 535 | unsigned long time_left; |
536 | 536 | ||
537 | tegra_i2c_flush_fifos(i2c_dev); | 537 | tegra_i2c_flush_fifos(i2c_dev); |
538 | 538 | ||
@@ -585,18 +585,20 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, | |||
585 | dev_dbg(i2c_dev->dev, "unmasked irq: %02x\n", | 585 | dev_dbg(i2c_dev->dev, "unmasked irq: %02x\n", |
586 | i2c_readl(i2c_dev, I2C_INT_MASK)); | 586 | i2c_readl(i2c_dev, I2C_INT_MASK)); |
587 | 587 | ||
588 | ret = wait_for_completion_timeout(&i2c_dev->msg_complete, TEGRA_I2C_TIMEOUT); | 588 | time_left = wait_for_completion_timeout(&i2c_dev->msg_complete, |
589 | TEGRA_I2C_TIMEOUT); | ||
589 | tegra_i2c_mask_irq(i2c_dev, int_mask); | 590 | tegra_i2c_mask_irq(i2c_dev, int_mask); |
590 | 591 | ||
591 | if (ret == 0) { | 592 | if (time_left == 0) { |
592 | dev_err(i2c_dev->dev, "i2c transfer timed out\n"); | 593 | dev_err(i2c_dev->dev, "i2c transfer timed out\n"); |
593 | 594 | ||
594 | tegra_i2c_init(i2c_dev); | 595 | tegra_i2c_init(i2c_dev); |
595 | return -ETIMEDOUT; | 596 | return -ETIMEDOUT; |
596 | } | 597 | } |
597 | 598 | ||
598 | dev_dbg(i2c_dev->dev, "transfer complete: %d %d %d\n", | 599 | dev_dbg(i2c_dev->dev, "transfer complete: %lu %d %d\n", |
599 | ret, completion_done(&i2c_dev->msg_complete), i2c_dev->msg_err); | 600 | time_left, completion_done(&i2c_dev->msg_complete), |
601 | i2c_dev->msg_err); | ||
600 | 602 | ||
601 | if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) | 603 | if (likely(i2c_dev->msg_err == I2C_ERR_NONE)) |
602 | return 0; | 604 | return 0; |