i2c: Make sure i2c_algo_bit_data.timeout is HZ-independent
authorJean Delvare <khali@linux-fr.org>
Tue, 24 Feb 2009 18:19:49 +0000 (19:19 +0100)
committerJean Delvare <khali@linux-fr.org>
Tue, 24 Feb 2009 18:19:49 +0000 (19:19 +0100)
i2c_algo_bit_data.timeout is supposed to be in jiffies, so drivers
should use set this value in terms of HZ.

Ultimately I think this field should be discarded in favor of
i2c_adapter.timeout, but that's left for a future patch.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Lennert Buytenhek <kernel@wantstofly.org>
Acked-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
drivers/i2c/busses/i2c-acorn.c
drivers/i2c/busses/i2c-ixp2000.c
drivers/i2c/busses/scx200_i2c.c

index 9fee3ca17344b9ab6adf895b4869a82e7d8bac6b..dddccdd91f930d8c0e02db24b4d0fa8edbc3d34b 100644 (file)
@@ -79,7 +79,7 @@ static struct i2c_algo_bit_data ioc_data = {
        .getsda         = ioc_getsda,
        .getscl         = ioc_getscl,
        .udelay         = 80,
-       .timeout        = 100
+       .timeout        = HZ,
 };
 
 static struct i2c_adapter ioc_ops = {
index 8e8467970481bb86972eadcb16bdb2dce7cf6a3d..c016f7a2c5fc2712433dbd83ec7d1c6dd1d48f3b 100644 (file)
@@ -114,7 +114,7 @@ static int ixp2000_i2c_probe(struct platform_device *plat_dev)
        drv_data->algo_data.getsda = ixp2000_bit_getsda;
        drv_data->algo_data.getscl = ixp2000_bit_getscl;
        drv_data->algo_data.udelay = 6;
-       drv_data->algo_data.timeout = 100;
+       drv_data->algo_data.timeout = HZ;
 
        strlcpy(drv_data->adapter.name, plat_dev->dev.driver->name,
                sizeof(drv_data->adapter.name));
index 162b74a04886c5497296579c6bbabda7015f2948..42df0eca43d5229b1fd88624e3fee4c369f0f462 100644 (file)
@@ -76,7 +76,7 @@ static struct i2c_algo_bit_data scx200_i2c_data = {
        .getsda         = scx200_i2c_getsda,
        .getscl         = scx200_i2c_getscl,
        .udelay         = 10,
-       .timeout        = 100,
+       .timeout        = HZ,
 };
 
 static struct i2c_adapter scx200_i2c_ops = {