diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-03-28 16:34:43 -0400 |
---|---|---|
committer | Jean Delvare <khali@linux-fr.org> | 2009-03-28 16:34:43 -0400 |
commit | 8a52c6b4d55b2960d93a90a7cf6afd252357fa54 (patch) | |
tree | bdc87e2591e4aa431389acba6efc45a7b620eb62 /drivers/i2c/busses/i2c-ibm_iic.c | |
parent | 8fcfef6e65c5b58e6482eae0b793319c8d9efd44 (diff) |
i2c: Adapter timeout is in jiffies
i2c_adapter.timeout is in jiffies. Fix all drivers which thought
otherwise. It didn't really matter as long as the value was only used
inside the driver, but soon i2c-core will use it too so it must have
the proper unit.
Note: for the i2c-mpc driver, this fixes a bug in polling mode.
Timeout would trigger after 1 jiffy, which is most probably not what
the author wanted.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Clifford Wolf <clifford@clifford.at>
Acked-by: Sean MacLennan <smaclennan@pikatech.com>
Cc: Stefan Roese <sr@denx.de>
Acked-by: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Diffstat (limited to 'drivers/i2c/busses/i2c-ibm_iic.c')
-rw-r--r-- | drivers/i2c/busses/i2c-ibm_iic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c index 88f0db73b364..8b92a4666e02 100644 --- a/drivers/i2c/busses/i2c-ibm_iic.c +++ b/drivers/i2c/busses/i2c-ibm_iic.c | |||
@@ -415,7 +415,7 @@ static int iic_wait_for_tc(struct ibm_iic_private* dev){ | |||
415 | if (dev->irq >= 0){ | 415 | if (dev->irq >= 0){ |
416 | /* Interrupt mode */ | 416 | /* Interrupt mode */ |
417 | ret = wait_event_interruptible_timeout(dev->wq, | 417 | ret = wait_event_interruptible_timeout(dev->wq, |
418 | !(in_8(&iic->sts) & STS_PT), dev->adap.timeout * HZ); | 418 | !(in_8(&iic->sts) & STS_PT), dev->adap.timeout); |
419 | 419 | ||
420 | if (unlikely(ret < 0)) | 420 | if (unlikely(ret < 0)) |
421 | DBG("%d: wait interrupted\n", dev->idx); | 421 | DBG("%d: wait interrupted\n", dev->idx); |
@@ -426,7 +426,7 @@ static int iic_wait_for_tc(struct ibm_iic_private* dev){ | |||
426 | } | 426 | } |
427 | else { | 427 | else { |
428 | /* Polling mode */ | 428 | /* Polling mode */ |
429 | unsigned long x = jiffies + dev->adap.timeout * HZ; | 429 | unsigned long x = jiffies + dev->adap.timeout; |
430 | 430 | ||
431 | while (in_8(&iic->sts) & STS_PT){ | 431 | while (in_8(&iic->sts) & STS_PT){ |
432 | if (unlikely(time_after(jiffies, x))){ | 432 | if (unlikely(time_after(jiffies, x))){ |
@@ -748,7 +748,7 @@ static int __devinit iic_probe(struct of_device *ofdev, | |||
748 | i2c_set_adapdata(adap, dev); | 748 | i2c_set_adapdata(adap, dev); |
749 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; | 749 | adap->class = I2C_CLASS_HWMON | I2C_CLASS_SPD; |
750 | adap->algo = &iic_algo; | 750 | adap->algo = &iic_algo; |
751 | adap->timeout = 1; | 751 | adap->timeout = HZ; |
752 | 752 | ||
753 | ret = i2c_add_adapter(adap); | 753 | ret = i2c_add_adapter(adap); |
754 | if (ret < 0) { | 754 | if (ret < 0) { |