diff options
author | Fabio Baltieri <fabio.baltieri@gmail.com> | 2014-06-08 23:06:24 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-06-12 17:36:18 +0200 |
commit | c0214f98943b1fe43f7be61b7782b0c8f0836f28 (patch) | |
tree | 5a820dc1926e81b18ed357f94d3a1bbcb9d59d32 /drivers/hwmon/lm85.c | |
parent | Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kerne... (diff) | |
download | linux-c0214f98943b1fe43f7be61b7782b0c8f0836f28.tar.xz linux-c0214f98943b1fe43f7be61b7782b0c8f0836f28.zip |
hwmon: (ina2xx) Cast to s16 on shunt and current regs
All devices supported by ina2xx are bidirectional and report the
measured shunt voltage and power values as a signed 16 bit, but the
current driver implementation caches all registers as u16, leading
to an incorrect sign extension when reporting to userspace in
ina2xx_get_value().
This patch fixes the problem by casting the signed registers to s16.
Tested on an INA219.
Signed-off-by: Fabio Baltieri <fabio.baltieri@gmail.com>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/lm85.c')
0 files changed, 0 insertions, 0 deletions