aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorNicholas Mc Guire <hofrat@osadl.org>2015-02-08 03:03:30 -0500
committerWolfram Sang <wsa@the-dreams.de>2015-03-15 05:50:02 -0400
commit1abdd5d957e1fc789a2981d27399f56b0682f53e (patch)
treec344972f4c49f81d97b54c65e6139c069f4d1571 /drivers/i2c
parent73958562f1ca5c91d802c845856c4a9edcf468cb (diff)
i2c: ismt: fix type of return var of wait_for_completion_timeout
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> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/busses/i2c-ismt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c
index f2b0ff011631..f994712d0904 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,
380 int size, union i2c_smbus_data *data) 380 int size, union i2c_smbus_data *data)
381{ 381{
382 int ret; 382 int ret;
383 unsigned long time_left;
383 dma_addr_t dma_addr = 0; /* address of the data buffer */ 384 dma_addr_t dma_addr = 0; /* address of the data buffer */
384 u8 dma_size = 0; 385 u8 dma_size = 0;
385 enum dma_data_direction dma_direction = 0; 386 enum dma_data_direction dma_direction = 0;
@@ -578,13 +579,13 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
578 ismt_submit_desc(priv); 579 ismt_submit_desc(priv);
579 580
580 /* Now we wait for interrupt completion, 1s */ 581 /* Now we wait for interrupt completion, 1s */
581 ret = wait_for_completion_timeout(&priv->cmp, HZ*1); 582 time_left = wait_for_completion_timeout(&priv->cmp, HZ*1);
582 583
583 /* unmap the data buffer */ 584 /* unmap the data buffer */
584 if (dma_size != 0) 585 if (dma_size != 0)
585 dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction); 586 dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction);
586 587
587 if (unlikely(!ret)) { 588 if (unlikely(!time_left)) {
588 dev_err(dev, "completion wait timed out\n"); 589 dev_err(dev, "completion wait timed out\n");
589 ret = -ETIMEDOUT; 590 ret = -ETIMEDOUT;
590 goto out; 591 goto out;