summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2015-02-08 11:12:07 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-03-15 10:54:08 +0100
commit1c42aca54fa0e738d9f0c0e5aa952d0e4357dcf0 (patch)
tree2c16f8077a7def4ae88e5bc5718cd22587fc5209 /drivers/i2c/busses
parent2abaccb356a857dbf4c978a69f2209e19c1a0db3 (diff)
downloadlinux-1c42aca54fa0e738d9f0c0e5aa952d0e4357dcf0.tar.bz2
i2c: at91: fixup return type of wait_for_completion_timeout
Return type of wait_for_completion_timeout is unsigned long not int. This patch adds a timeout variable of appropriate type and fixes up the assignment. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-at91.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index b3a70e8fc653..ff23d1bdd230 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -381,6 +381,7 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id)
static int at91_do_twi_transfer(struct at91_twi_dev *dev)
{
int ret;
+ unsigned long time_left;
bool has_unre_flag = dev->pdata->has_unre_flag;
dev_dbg(dev->dev, "transfer: %s %d bytes.\n",
@@ -436,9 +437,9 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
}
}
- ret = wait_for_completion_timeout(&dev->cmd_complete,
- dev->adapter.timeout);
- if (ret == 0) {
+ time_left = wait_for_completion_timeout(&dev->cmd_complete,
+ dev->adapter.timeout);
+ if (time_left == 0) {
dev_err(dev->dev, "controller timed out\n");
at91_init_twi_bus(dev);
ret = -ETIMEDOUT;