From 4d0ca82e17f9ef8a5878d8a189b77f9168a4fe65 Mon Sep 17 00:00:00 2001 From: Olivier Sobrie Date: Mon, 26 Mar 2012 21:47:18 +0200 Subject: [PATCH] --- yaml --- r: 296941 b: refs/heads/master c: b3240e68c05deef2df28db9fc0eea4c277f76494 h: refs/heads/master i: 296939: 74f61982c596e3d1e493c9b092551f0e6993cee9 v: v3 --- [refs] | 2 +- trunk/drivers/i2c/busses/i2c-isch.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index bbf72e6a8217..4412d31b7236 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c54c35572a30da2fa028c1dc045facac4ee5640a +refs/heads/master: b3240e68c05deef2df28db9fc0eea4c277f76494 diff --git a/trunk/drivers/i2c/busses/i2c-isch.c b/trunk/drivers/i2c/busses/i2c-isch.c index 6561d275b8cf..f90a6057508d 100644 --- a/trunk/drivers/i2c/busses/i2c-isch.c +++ b/trunk/drivers/i2c/busses/i2c-isch.c @@ -47,7 +47,7 @@ #define SMBBLKDAT (0x20 + sch_smba) /* Other settings */ -#define MAX_TIMEOUT 500 +#define MAX_RETRIES 5000 /* I2C constants */ #define SCH_QUICK 0x00 @@ -68,7 +68,7 @@ static int sch_transaction(void) { int temp; int result = 0; - int timeout = 0; + int retries = 0; dev_dbg(&sch_adapter.dev, "Transaction (pre): CNT=%02x, CMD=%02x, " "ADD=%02x, DAT0=%02x, DAT1=%02x\n", inb(SMBHSTCNT), @@ -100,12 +100,12 @@ static int sch_transaction(void) outb(inb(SMBHSTCNT) | 0x10, SMBHSTCNT); do { - msleep(1); + usleep_range(100, 200); temp = inb(SMBHSTSTS) & 0x0f; - } while ((temp & 0x08) && (timeout++ < MAX_TIMEOUT)); + } while ((temp & 0x08) && (retries++ < MAX_RETRIES)); /* If the SMBus is still busy, we give up */ - if (timeout > MAX_TIMEOUT) { + if (retries > MAX_RETRIES) { dev_err(&sch_adapter.dev, "SMBus Timeout!\n"); result = -ETIMEDOUT; }