diff mbox

i2c: ismt: fix type of return var of wait_for_completion_timeout

Message ID 1423382611-24463-1-git-send-email-hofrat@osadl.org
State Accepted
Headers show

Commit Message

Nicholas Mc Guire Feb. 8, 2015, 8:03 a.m. UTC
return type of wait_for_completion_timeout is unsigned long not int. As 
ret is in used for other calls a new appropriately typed variable timeout
is added to handle wait_for_completion_timeout 

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Patch was only compile tested with x86_64_defconfig + CONFIG_I2C_ISMT=m

Patch is against 3.19.0-rc7 (localversion-next is -next-20150204)

 drivers/i2c/busses/i2c-ismt.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Neil Horman Feb. 8, 2015, 1:53 p.m. UTC | #1
On Sun, Feb 08, 2015 at 03:03:30AM -0500, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. As 
> ret is in used for other calls a new appropriately typed variable timeout
> is added to handle wait_for_completion_timeout 
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Acked-by: Neil Horman <nhorman@tuxdriver.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang March 15, 2015, 10:02 a.m. UTC | #2
On Sun, Feb 08, 2015 at 03:03:30AM -0500, Nicholas Mc Guire wrote:
> return type of wait_for_completion_timeout is unsigned long not int. As 
> ret is in used for other calls a new appropriately typed variable timeout
> is added to handle wait_for_completion_timeout 
> 
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>

Fixed variable name to 'time_left' and applied to for-next, thanks!
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
index f2b0ff0..2197ac8 100644
--- a/drivers/i2c/busses/i2c-ismt.c
+++ b/drivers/i2c/busses/i2c-ismt.c
@@ -380,6 +380,7 @@  static int ismt_access(struct i2c_adapter *adap, u16 addr,
 		       int size, union i2c_smbus_data *data)
 {
 	int ret;
+	unsigned long timeout;
 	dma_addr_t dma_addr = 0; /* address of the data buffer */
 	u8 dma_size = 0;
 	enum dma_data_direction dma_direction = 0;
@@ -578,13 +579,13 @@  static int ismt_access(struct i2c_adapter *adap, u16 addr,
 	ismt_submit_desc(priv);
 
 	/* Now we wait for interrupt completion, 1s */
-	ret = wait_for_completion_timeout(&priv->cmp, HZ*1);
+	timeout = wait_for_completion_timeout(&priv->cmp, HZ*1);
 
 	/* unmap the data buffer */
 	if (dma_size != 0)
 		dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction);
 
-	if (unlikely(!ret)) {
+	if (unlikely(!timeout)) {
 		dev_err(dev, "completion wait timed out\n");
 		ret = -ETIMEDOUT;
 		goto out;