Re: [PATCH 3/5] hwmon: (ina2xx) Fix word size register read and write operations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxx>
> ---
> 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.

Acked-by: Jean Delvare <khali@xxxxxxxxxxxx>

-- 
Jean Delvare

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux