summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorEliav Farber <farbere@amazon.com>2022-09-21 15:17:23 +0300
committerGuenter Roeck <linux@roeck-us.net>2022-09-26 00:22:11 +0300
commit903882c767051a17c1535b2a820e2931ee44b8fb (patch)
tree0b636dc794e7731d677ce0404d28a2c04dff7d5d /drivers/hwmon
parentac387b0cb34b35e098dee52ef3856fa4afe35ab2 (diff)
downloadlinux-903882c767051a17c1535b2a820e2931ee44b8fb.tar.xz
hwmon: (mr75203) fix undefined reference to `__divdi3'
Fix build error on 32-bit machines. Fixes: 94c025b6f735 ("hwmon: (mr75203) modify the temperature equation according to series 5 datasheet") Signed-off-by: Eliav Farber <farbere@amazon.com> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Link: https://lore.kernel.org/r/20220921121723.6726-1-farbere@amazon.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/mr75203.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c
index 667c764e0c2c..01f63dc1a250 100644
--- a/drivers/hwmon/mr75203.c
+++ b/drivers/hwmon/mr75203.c
@@ -266,9 +266,9 @@ static long pvt_calc_temp(struct pvt_device *pvt, u32 nbs)
struct temp_coeff *ts_coeff = &pvt->ts_coeff;
s64 tmp = ts_coeff->g +
- ts_coeff->h * (s64)nbs / ts_coeff->cal5 -
+ div_s64(ts_coeff->h * (s64)nbs, ts_coeff->cal5) -
ts_coeff->h / 2 +
- ts_coeff->j * (s64)pvt->ip_freq / HZ_PER_MHZ;
+ div_s64(ts_coeff->j * (s64)pvt->ip_freq, HZ_PER_MHZ);
return clamp_val(tmp, PVT_TEMP_MIN_mC, PVT_TEMP_MAX_mC);
}