]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (ina2xx) Fix word size register read and write operations
authorGuenter Roeck <linux@roeck-us.net>
Tue, 11 Sep 2012 15:22:14 +0000 (08:22 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 12 Sep 2012 13:42:11 +0000 (06:42 -0700)
commit22923cb16ecb6e902c4431df9f799f48c9d305a7
tree9364a6d861f480ff494040402f8e196ae115c23f
parent336fe72b1c7cc6c5d0d0fa35f74d8ce1bb420549
hwmon: (ina2xx) Fix word size register read and write operations

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>
Cc: stable@vger.kernel.org # 3.5+
Acked-by: Jean Delvare <khali@linux-fr.org>
drivers/hwmon/ina2xx.c