Message ID | 20230109233534.1932370-6-jcormier@criticallink.com |
---|---|
State | Superseded |
Headers | show |
Series | hwmon: ltc2945: Add binding and shunt resistor support | expand |
diff --git a/drivers/hwmon/ltc2945.c b/drivers/hwmon/ltc2945.c index 0d743d75459c..5456c1b60b8b 100644 --- a/drivers/hwmon/ltc2945.c +++ b/drivers/hwmon/ltc2945.c @@ -203,7 +203,7 @@ static int ltc2945_val_to_reg(struct device *dev, u8 reg, case LTC2945_MAX_VIN_THRES_H: case LTC2945_MIN_VIN_THRES_H: /* 25 mV resolution. */ - val /= 25; + val = DIV_ROUND_CLOSEST_ULL(val, 25); break; case LTC2945_ADIN_H: case LTC2945_MAX_ADIN_H:
Convert division to DIV_ROUND_CLOSEST_ULL to match code in same function Signed-off-by: Jonathan Cormier <jcormier@criticallink.com> --- drivers/hwmon/ltc2945.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)