diff options
| author | Nicolin Chen <nicoleotsuka@gmail.com> | 2018-11-13 19:48:54 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-12-17 21:55:10 +0100 |
| commit | 15d8d7246173d11e7b75e34bc0226682468f9a8c (patch) | |
| tree | 88959a0ea1239eb159e00f8613ef7a2d4e4a31b6 /sound/soc/soc-core.c | |
| parent | 9ba7a303ff290d21bade27317337505640e556c0 (diff) | |
hwmon: (ina2xx) Fix current value calculation
[ Upstream commit 38cd989ee38c16388cde89db5b734f9d55b905f9 ]
The current register (04h) has a sign bit at MSB. The comments
for this calculation also mention that it's a signed register.
However, the regval is unsigned type so result of calculation
turns out to be an incorrect value when current is negative.
This patch simply fixes this by adding a casting to s16.
Fixes: 5d389b125186c ("hwmon: (ina2xx) Make calibration register value fixed")
Signed-off-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/soc/soc-core.c')
0 files changed, 0 insertions, 0 deletions
