[lm-sensors] [PATCH] hwmon: (max16065) Fix current calculation
Jean Delvare
khali at linux-fr.org
Mon Aug 29 11:08:35 CEST 2011
On Sun, 28 Aug 2011 13:34:05 -0700, Guenter Roeck wrote:
> Current calculation is completely wrong. Add missing brackets to fix it.
>
> Signed-off-by: Guenter Roeck <guenter.roeck at ericsson.com>
> ---
> Candidate for stable (2.6.39+).
>
> drivers/hwmon/max16065.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c
> index d94a24f..dd2d7b9 100644
> --- a/drivers/hwmon/max16065.c
> +++ b/drivers/hwmon/max16065.c
> @@ -124,7 +124,7 @@ static inline int MV_TO_LIMIT(int mv, int range)
>
> static inline int ADC_TO_CURR(int adc, int gain)
> {
> - return adc * 1400000 / gain * 255;
> + return adc * 1400000 / (gain * 255);
> }
>
> /*
Good catch.
Acked-by: Jean Delvare <khali at linux-fr.org>
--
Jean Delvare
More information about the lm-sensors
mailing list