summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorFabio Baltieri <fabio.baltieri@gmail.com>2014-06-08 22:06:24 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-09 11:14:01 -0700
commit172a9e9a5fa2ee9db57769a7be4f11eec27437ee (patch)
tree624bf5db331847c383137a517e3645d64c96ce28 /net
parent7029f0641d23ca194e7a596bf8761194b7b70d92 (diff)
downloadlinux-3.10-172a9e9a5fa2ee9db57769a7be4f11eec27437ee.tar.gz
linux-3.10-172a9e9a5fa2ee9db57769a7be4f11eec27437ee.tar.bz2
linux-3.10-172a9e9a5fa2ee9db57769a7be4f11eec27437ee.zip
hwmon: (ina2xx) Cast to s16 on shunt and current regs
commit c0214f98943b1fe43f7be61b7782b0c8f0836f28 upstream. 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> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions