Skip to content

Commit

Permalink
hwmon: (max16065) Fix current calculation
Browse files Browse the repository at this point in the history
Current calculation is completely wrong. Add missing brackets to fix it.

Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Cc: stable@kernel.org # 3.0+
  • Loading branch information
Guenter Roeck committed Sep 6, 2011
1 parent ddf2835 commit ff71c18
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hwmon/max16065.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit ff71c18

Please sign in to comment.