Revert "hwmon: (max16065) Fix overflows seen when writing limits"
This reverts commit 177d70c1eb
.
This commit is contained in:
parent
b4841d2300
commit
86504fcf57
1 changed files with 2 additions and 3 deletions
|
@ -114,10 +114,9 @@ static inline int LIMIT_TO_MV(int limit, int range)
|
|||
return limit * range / 256;
|
||||
}
|
||||
|
||||
static inline int MV_TO_LIMIT(unsigned long mv, int range)
|
||||
static inline int MV_TO_LIMIT(int mv, int range)
|
||||
{
|
||||
mv = clamp_val(mv, 0, ULONG_MAX / 256);
|
||||
return DIV_ROUND_CLOSEST(clamp_val(mv * 256, 0, range * 255), range);
|
||||
return clamp_val(DIV_ROUND_CLOSEST(mv * 256, range), 0, 255);
|
||||
}
|
||||
|
||||
static inline int ADC_TO_CURR(int adc, int gain)
|
||||
|
|
Loading…
Add table
Reference in a new issue