mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Martin Schlemmer <azarah@gentoo.org>
To: Greg KH <greg@kroah.com>
Cc: Andrey Borzenkov <arvidjaar@mail.ru>,
	LKML <linux-kernel@vger.kernel.org>,
	Sensors <sensors@stimpy.netroedge.com>
Subject: [PATCH 2.6] Fix conversion from milli volts in store_in_reg() for w83781d.c
Date: Wed, 03 Sep 2003 22:54:12 +0200	[thread overview]
Message-ID: <1062622452.5275.38.camel@nosferatu.lan> (raw)
In-Reply-To: <20030616184149.GC25585@kroah.com>


[-- Attachment #1.1: Type: text/plain, Size: 1048 bytes --]

Hi

I am not sure if it was a later patch from me that fixed in_* to display
milli volts in sysfs, or if it was a patch from Jan Dittmer, but the
conversion in the store_in_*() functions is wrong, and cause something
like:

----------------------------
nosferatu patch # cat /sys/bus/i2c/devices/1-0290/in_max2
3632
nosferatu patch # echo '3700' > /sys/bus/i2c/devices/1-0290/in_max2
nosferatu patch # cat /sys/bus/i2c/devices/1-0290/in_max2
400
nosferatu patch # echo '3640' > /sys/bus/i2c/devices/1-0290/in_max2
nosferatu patch # cat /sys/bus/i2c/devices/1-0290/in_max2
400
nosferatu patch # echo '3632' > /sys/bus/i2c/devices/1-0290/in_max2
nosferatu patch # cat /sys/bus/i2c/devices/1-0290/in_max2
400
nosferatu patch #
-----------------------------

I think Andrey also noticed this (if I did not smoke too much Weedbix
this morning ;) - if so, please verify that this fixes it ... it does
here at least.

Anyhow, patch is attached and should apply to 2.6.0-test4-bk5.


Regards,

-- 

Martin Schlemmer




[-- Attachment #1.2: w83781d-fixup-in_store.patch --]
[-- Type: text/plain, Size: 570 bytes --]

--- 1/drivers/i2c/chips/w83781d.c	2003-09-03 22:42:02.199165296 +0200
+++ 2/drivers/i2c/chips/w83781d.c	2003-09-03 22:35:02.378987664 +0200
@@ -378,8 +378,8 @@ static ssize_t store_in_##reg (struct de
 	struct w83781d_data *data = i2c_get_clientdata(client); \
 	u32 val; \
 	 \
-	val = simple_strtoul(buf, NULL, 10); \
-	data->in_##reg[nr] = (IN_TO_REG(val) / 10); \
+	val = simple_strtoul(buf, NULL, 10) / 10; \
+	data->in_##reg[nr] = IN_TO_REG(val); \
 	w83781d_write_value(client, W83781D_REG_IN_##REG(nr), data->in_##reg[nr]); \
 	 \
 	return count; \

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2003-09-03 20:54 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-24 18:37 [OOPS] w83781d during rmmod (2.5.69-bk17) Mark M. Hoffman
     [not found] ` <3ED8067E.1050503@paradyne.com>
2003-06-01 14:38   ` [RFC PATCH] " Mark M. Hoffman
2003-06-02 17:20     ` Greg KH
2003-06-03  5:22       ` Martin Schlemmer
2003-06-03 19:43         ` Philip Pokorny
2003-06-04  5:57           ` Martin Schlemmer
2003-06-05  2:39       ` Mark M. Hoffman
2003-06-05 19:47         ` Greg KH
2003-06-09  5:34           ` Martin Schlemmer
2003-06-10  5:38             ` Martin Schlemmer
2003-06-10  5:41             ` OOPS w83781d during rmmod (2.5.70-bk1[1234]) Mark M. Hoffman
2003-06-10  5:51               ` Martin Schlemmer
2003-06-11  5:44                 ` Martin Schlemmer
2003-06-12  6:57               ` [RFC][2.5] list_for_each_safe not so safe (was Re: OOPS w83781d during rmmod (2.5.70-bk1[1234])) Martin Schlemmer
2003-06-13  2:36                 ` Mark M. Hoffman
2003-06-13  6:08                   ` Martin Schlemmer
2003-06-14  6:26                   ` Martin Schlemmer
2003-06-16 18:41                     ` Greg KH
2003-09-03 20:54                       ` Martin Schlemmer [this message]
2003-09-04 18:40                         ` [PATCH 2.6] Fix conversion from milli volts in store_in_reg() for w83781d.c Greg KH
2003-09-07 15:41                         ` Andrey Borzenkov

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=1062622452.5275.38.camel@nosferatu.lan \
    --to=azarah@gentoo.org \
    --cc=arvidjaar@mail.ru \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sensors@stimpy.netroedge.com \
    /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

Powered by JetHome