]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
i2c: at91: fixup return type of wait_for_completion_timeout
authorNicholas Mc Guire <hofrat@osadl.org>
Sun, 8 Feb 2015 16:12:07 +0000 (11:12 -0500)
committerWolfram Sang <wsa@the-dreams.de>
Sun, 15 Mar 2015 09:54:08 +0000 (10:54 +0100)
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>
drivers/i2c/busses/i2c-at91.c

index b3a70e8fc653c5fa42a9614180863af4a15a8a25..ff23d1bdd23072c6c5cec5f690b048ae4dee0f8e 100644 (file)
@@ -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;