aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mv64xxx.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2009-03-28 16:34:43 -0400
committerJean Delvare <khali@linux-fr.org>2009-03-28 16:34:43 -0400
commit8a52c6b4d55b2960d93a90a7cf6afd252357fa54 (patch)
treebdc87e2591e4aa431389acba6efc45a7b620eb62 /drivers/i2c/busses/i2c-mv64xxx.c
parent8fcfef6e65c5b58e6482eae0b793319c8d9efd44 (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-mv64xxx.c')
-rw-r--r--drivers/i2c/busses/i2c-mv64xxx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c
index 7f186bbcb99d..5a4945d1dba4 100644
--- a/drivers/i2c/busses/i2c-mv64xxx.c
+++ b/drivers/i2c/busses/i2c-mv64xxx.c
@@ -358,7 +358,7 @@ mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data)
358 char abort = 0; 358 char abort = 0;
359 359
360 time_left = wait_event_interruptible_timeout(drv_data->waitq, 360 time_left = wait_event_interruptible_timeout(drv_data->waitq,
361 !drv_data->block, msecs_to_jiffies(drv_data->adapter.timeout)); 361 !drv_data->block, drv_data->adapter.timeout);
362 362
363 spin_lock_irqsave(&drv_data->lock, flags); 363 spin_lock_irqsave(&drv_data->lock, flags);
364 if (!time_left) { /* Timed out */ 364 if (!time_left) { /* Timed out */
@@ -374,8 +374,7 @@ mv64xxx_i2c_wait_for_completion(struct mv64xxx_i2c_data *drv_data)
374 spin_unlock_irqrestore(&drv_data->lock, flags); 374 spin_unlock_irqrestore(&drv_data->lock, flags);
375 375
376 time_left = wait_event_timeout(drv_data->waitq, 376 time_left = wait_event_timeout(drv_data->waitq,
377 !drv_data->block, 377 !drv_data->block, drv_data->adapter.timeout);
378 msecs_to_jiffies(drv_data->adapter.timeout));
379 378
380 if ((time_left <= 0) && drv_data->block) { 379 if ((time_left <= 0) && drv_data->block) {
381 drv_data->state = MV64XXX_I2C_STATE_IDLE; 380 drv_data->state = MV64XXX_I2C_STATE_IDLE;
@@ -530,7 +529,7 @@ mv64xxx_i2c_probe(struct platform_device *pd)
530 drv_data->adapter.algo = &mv64xxx_i2c_algo; 529 drv_data->adapter.algo = &mv64xxx_i2c_algo;
531 drv_data->adapter.owner = THIS_MODULE; 530 drv_data->adapter.owner = THIS_MODULE;
532 drv_data->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD; 531 drv_data->adapter.class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
533 drv_data->adapter.timeout = pdata->timeout; 532 drv_data->adapter.timeout = msecs_to_jiffies(pdata->timeout);
534 drv_data->adapter.nr = pd->id; 533 drv_data->adapter.nr = pd->id;
535 platform_set_drvdata(pd, drv_data); 534 platform_set_drvdata(pd, drv_data);
536 i2c_set_adapdata(&drv_data->adapter, drv_data); 535 i2c_set_adapdata(&drv_data->adapter, drv_data);