From: Jean Delvare <khali@linux-fr.org>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] possible error in ams-i2c.c
Date: Mon, 02 Apr 2007 05:43:42 +0000 [thread overview]
Message-ID: <20070402074342.feb78af0.khali@linux-fr.org> (raw)
On Fri, 30 Mar 2007 21:41:37 +0200, Stelian Pop wrote:
> Fix sleep and retry logic in ams-i2c.
>
> Signed-off-by: Stelian Pop <stelian@popies.net>
> ---
> drivers/hwmon/ams/ams-i2c.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c
> index 0d24bdf..6f5b423 100644
> --- a/drivers/hwmon/ams/ams-i2c.c
> +++ b/drivers/hwmon/ams/ams-i2c.c
> @@ -85,17 +85,17 @@ static int ams_i2c_write(u8 reg, u8 value)
> static int ams_i2c_cmd(enum ams_i2c_cmd cmd)
> {
> s32 result;
> - int remaining = HZ / 20;
> + int count = 3;
>
> ams_i2c_write(AMS_COMMAND, cmd);
> - mdelay(5);
> + msleep(5);
>
> - while (remaining) {
> + while (count--) {
> result = ams_i2c_read(AMS_COMMAND);
> if (result = 0 || result & 0x80)
> return 0;
>
> - remaining = schedule_timeout(remaining);
> + schedule_timeout_uninterruptible(HZ / 20);
> }
>
> return -1;
Applied, thanks.
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next reply other threads:[~2007-04-02 5:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-02 5:43 Jean Delvare [this message]
-- strict thread matches above, loose matches on Subject: below --
2007-03-30 19:41 [lm-sensors] possible error in ams-i2c.c Stelian Pop
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=20070402074342.feb78af0.khali@linux-fr.org \
--to=khali@linux-fr.org \
--cc=lm-sensors@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.