Commit 1c42aca5 authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Wolfram Sang

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: default avatarNicholas Mc Guire <hofrat@osadl.org>
Acked-by: default avatarLudovic Desroches <ludovic.desroches@atmel.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 2abaccb3
...@@ -381,6 +381,7 @@ static irqreturn_t atmel_twi_interrupt(int irq, void *dev_id) ...@@ -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) static int at91_do_twi_transfer(struct at91_twi_dev *dev)
{ {
int ret; int ret;
unsigned long time_left;
bool has_unre_flag = dev->pdata->has_unre_flag; bool has_unre_flag = dev->pdata->has_unre_flag;
dev_dbg(dev->dev, "transfer: %s %d bytes.\n", dev_dbg(dev->dev, "transfer: %s %d bytes.\n",
...@@ -436,9 +437,9 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev) ...@@ -436,9 +437,9 @@ static int at91_do_twi_transfer(struct at91_twi_dev *dev)
} }
} }
ret = wait_for_completion_timeout(&dev->cmd_complete, time_left = wait_for_completion_timeout(&dev->cmd_complete,
dev->adapter.timeout); dev->adapter.timeout);
if (ret == 0) { if (time_left == 0) {
dev_err(dev->dev, "controller timed out\n"); dev_err(dev->dev, "controller timed out\n");
at91_init_twi_bus(dev); at91_init_twi_bus(dev);
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
......
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