From: Guenter Roeck <linux@roeck-us.net>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH 3/5] hwmon: (ina2xx) Fix word size register read and write operations
Date: Wed, 12 Sep 2012 13:41:19 +0000 [thread overview]
Message-ID: <20120912134119.GA19924@roeck-us.net> (raw)
In-Reply-To: <1347381259-14585-4-git-send-email-linux@roeck-us.net>
On Wed, Sep 12, 2012 at 10:24:41AM +0200, Jean Delvare wrote:
> On Tue, 11 Sep 2012 09:34:17 -0700, Guenter Roeck wrote:
> > The driver uses be16_to_cpu and cpu_to_be16 to convert data in SMBus word
> > operations from chip to host byte order. However, the data passed from and to
> > the SMBus word API functions is in host byte order, not in chip byte order.
> > Conversion should therefore use swab16 instead of be16 to change the byte order.
> >
> > Replace driver internal word conversion functions with SMBus API functions to
> > solve the problem.
> >
> > Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> > ---
> > Candidate for 3.6 and -stable.
>
> Agreed, down to 3.2 (when i2c_smbus_read/write_word_swapped were
> introduced.) If anyone needs the fix for a kernel older than this, it
> will have to be implemented differently.
>
Fortunately, that driver was only introduced in 3.5 (and I didn't realize the
be16 problem when reviewing it ;).
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
next prev parent reply other threads:[~2012-09-12 13:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 16:34 [lm-sensors] [PATCH 3/5] hwmon: (ina2xx) Fix word size register read and write operations Guenter Roeck
2012-09-12 8:24 ` Jean Delvare
2012-09-12 13:41 ` Guenter Roeck [this message]
2012-09-12 13:49 ` Jean Delvare
2012-09-12 14:02 ` Guenter Roeck
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=20120912134119.GA19924@roeck-us.net \
--to=linux@roeck-us.net \
--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.