summaryrefslogtreecommitdiff
path: root/ifpps/.gitignore
diff options
context:
space:
mode:
Diffstat (limited to 'ifpps/.gitignore')
0 files changed, 0 insertions, 0 deletions
vers/hwmon/ina2xx.c?id=5c02c392cd2320e8d612376d6b72b6548a680923'>5c02c392cd2320e8d612376d6b72b6548a680923 (diff)
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/ina2xx.c')