summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-pca-platform.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-10-18 18:43:43 +0200
committerIngo Molnar <mingo@elte.hu>2010-10-18 18:43:46 +0200
commitf2f108eb4511f22a6f7568090cfcf4e7b2dc0f62 (patch)
tree4b75771ec02543372808c7df31a1a65e37fdb361 /drivers/i2c/busses/i2c-pca-platform.c
parent756b0322e50aebc4b9afb4488a2d3f6c802b4e64 (diff)
parent2b666ca4a68cbc22483b0f2e1ba3c0e59b01ae9e (diff)
Merge branch 'linus' into core/locking
Merge reason: Update to almost-final-.36 Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/i2c/busses/i2c-pca-platform.c')
-rw-r--r--drivers/i2c/busses/i2c-pca-platform.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c
index ef5c78487eb..5f6d7f89e22 100644
--- a/drivers/i2c/busses/i2c-pca-platform.c
+++ b/drivers/i2c/busses/i2c-pca-platform.c
@@ -80,8 +80,8 @@ static void i2c_pca_pf_writebyte32(void *pd, int reg, int val)
static int i2c_pca_pf_waitforcompletion(void *pd)
{
struct i2c_pca_pf_data *i2c = pd;
- long ret = ~0;
unsigned long timeout;
+ long ret;
if (i2c->irq) {
ret = wait_event_timeout(i2c->wait,
@@ -90,10 +90,13 @@ static int i2c_pca_pf_waitforcompletion(void *pd)
} else {
/* Do polling */
timeout = jiffies + i2c->adap.timeout;
- while (((i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
- & I2C_PCA_CON_SI) == 0)
- && (ret = time_before(jiffies, timeout)))
+ do {
+ ret = time_before(jiffies, timeout);
+ if (i2c->algo_data.read_byte(i2c, I2C_PCA_CON)
+ & I2C_PCA_CON_SI)
+ break;
udelay(100);
+ } while (ret);
}
return ret > 0;