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

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: default avatarNicholas Mc Guire <hofrat@osadl.org>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 73958562
...@@ -380,6 +380,7 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, ...@@ -380,6 +380,7 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
int size, union i2c_smbus_data *data) int size, union i2c_smbus_data *data)
{ {
int ret; int ret;
unsigned long time_left;
dma_addr_t dma_addr = 0; /* address of the data buffer */ dma_addr_t dma_addr = 0; /* address of the data buffer */
u8 dma_size = 0; u8 dma_size = 0;
enum dma_data_direction dma_direction = 0; enum dma_data_direction dma_direction = 0;
...@@ -578,13 +579,13 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, ...@@ -578,13 +579,13 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr,
ismt_submit_desc(priv); ismt_submit_desc(priv);
/* Now we wait for interrupt completion, 1s */ /* Now we wait for interrupt completion, 1s */
ret = wait_for_completion_timeout(&priv->cmp, HZ*1); time_left = wait_for_completion_timeout(&priv->cmp, HZ*1);
/* unmap the data buffer */ /* unmap the data buffer */
if (dma_size != 0) if (dma_size != 0)
dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction); dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction);
if (unlikely(!ret)) { if (unlikely(!time_left)) {
dev_err(dev, "completion wait timed out\n"); dev_err(dev, "completion wait timed out\n");
ret = -ETIMEDOUT; ret = -ETIMEDOUT;
goto out; goto out;
......
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