From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Lennert Buytenhek
<kernel-OLH4Qvv75CYX/NnBR394Jw@public.gmane.org>,
Len Sorensen
<lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys@public.gmane.org>
Subject: [PATCH] i2c: Make sure i2c_algo_bit_data.timeout is HZ-independent
Date: Sun, 22 Feb 2009 12:50:05 +0100 [thread overview]
Message-ID: <20090222125005.75b2d661@hyperion.delvare> (raw)
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-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
Cc: Russell King <rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>
Cc: Lennert Buytenhek <kernel-OLH4Qvv75CYX/NnBR394Jw@public.gmane.org>
Cc: Len Sorensen <lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys@public.gmane.org>
---
drivers/i2c/busses/i2c-acorn.c | 2 +-
drivers/i2c/busses/i2c-ixp2000.c | 2 +-
drivers/i2c/busses/scx200_i2c.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--- linux-2.6.29-rc5.orig/drivers/i2c/busses/scx200_i2c.c 2009-02-22 12:32:33.000000000 +0100
+++ linux-2.6.29-rc5/drivers/i2c/busses/scx200_i2c.c 2009-02-22 12:32:45.000000000 +0100
@@ -76,7 +76,7 @@ static struct i2c_algo_bit_data scx200_i
.getsda = scx200_i2c_getsda,
.getscl = scx200_i2c_getscl,
.udelay = 10,
- .timeout = 100,
+ .timeout = HZ,
};
static struct i2c_adapter scx200_i2c_ops = {
--- linux-2.6.29-rc5.orig/drivers/i2c/busses/i2c-acorn.c 2009-02-22 12:32:33.000000000 +0100
+++ linux-2.6.29-rc5/drivers/i2c/busses/i2c-acorn.c 2009-02-22 12:32:45.000000000 +0100
@@ -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 = {
--- linux-2.6.29-rc5.orig/drivers/i2c/busses/i2c-ixp2000.c 2009-02-22 12:32:33.000000000 +0100
+++ linux-2.6.29-rc5/drivers/i2c/busses/i2c-ixp2000.c 2009-02-22 12:32:45.000000000 +0100
@@ -114,7 +114,7 @@ static int ixp2000_i2c_probe(struct plat
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));
--
Jean Delvare
next reply other threads:[~2009-02-22 11:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-22 11:50 Jean Delvare [this message]
[not found] ` <20090222125005.75b2d661-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-02-22 11:52 ` [PATCH] i2c: Make sure i2c_algo_bit_data.timeout is HZ-independent Lennert Buytenhek
2009-02-22 12:03 ` Russell King
2009-02-23 15:00 ` Lennart Sorensen
[not found] ` <20090223150012.GD23244-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys@public.gmane.org>
2009-02-23 15:20 ` Jean Delvare
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090222125005.75b2d661@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=kernel-OLH4Qvv75CYX/NnBR394Jw@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys@public.gmane.org \
--cc=rmk+kernel-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox