Skip to content
Commit 30a455ac authored by Alexandru Gagniuc's avatar Alexandru Gagniuc Committed by Greg Kroah-Hartman
Browse files

hwmon: (tps23861) fix byte order in resistance register

commit 1f05f65b

 upstream.

The tps23861 registers are little-endian, and regmap_read_bulk() does
not do byte order conversion. On BE machines, the bytes were swapped,
and the interpretation of the resistance value was incorrect.

To make it work on both big and little-endian machines, use
le16_to_cpu() to convert the resitance register to host byte order.

Signed-off-by: default avatarAlexandru Gagniuc <mr.nuke.me@gmail.com>
Fixes: fff7b8ab

 ("hwmon: add Texas Instruments TPS23861 driver")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220905142806.110598-1-mr.nuke.me@gmail.com
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 159d35a8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment