hwmon: (w83795) Fix LSB reading of voltage limits

Wrong index caused the wrong register value to be read, resulting in
random LSB for voltage limits.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
Jean Delvare 2010-10-28 20:31:49 +02:00 committed by Jean Delvare
parent 21fc977551
commit 5d2cd958f7
1 changed files with 1 additions and 1 deletions

View File

@ -1405,7 +1405,7 @@ show_in(struct device *dev, struct device_attribute *attr, char *buf)
lsb_idx = IN_LSB_SHIFT_IDX[index][IN_LSB_IDX];
val <<= 2;
val |= (data->in_lsb[lsb_idx][nr] >>
IN_LSB_SHIFT_IDX[lsb_idx][IN_LSB_SHIFT]) & 0x03;
IN_LSB_SHIFT_IDX[index][IN_LSB_SHIFT]) & 0x03;
if ((index >= 17) &&
!((data->has_gain >> (index - 17)) & 1))
val *= 8;