hwmon: ina230: add type casting for negative current
authorBo Kim <bok@nvidia.com>
Thu, 20 Jun 2013 09:30:53 +0000 (18:30 +0900)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 20:31:08 +0000 (13:31 -0700)
commit3d50383690fbb91fd3a5e1118376ebb99080be5a
tree3aab8c0d208767df1f2b8ce118afe93245e6c14b
parent970bac10a2e86f5b98ca3b916b31c03433d65040
hwmon: ina230: add type casting for negative current

When precision_multiplier has positive value and current has negative
value, the calculation makes wrong result by implicit type casting.

Bug 1311630

Change-Id: I272783d1e081059a296a1cce33f660cfb1fcd52b
Signed-off-by: Bo Kim <bok@nvidia.com>
Reviewed-on: http://git-master/r/245046
(cherry picked from commit a62ae4ba0b076ee2349ff3503656e8d9812c0e72)
Reviewed-on: http://git-master/r/248236
Reviewed-by: Hyong Bin Kim <hyongbink@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/hwmon/ina230.c